Home | History | Annotate | Download | only in chromeos
      1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_CHROMEOS_EXTERNAL_PROTOCOL_DIALOG_H_
      6 #define CHROME_BROWSER_CHROMEOS_EXTERNAL_PROTOCOL_DIALOG_H_
      7 
      8 #include <string>
      9 
     10 #include "base/strings/string16.h"
     11 #include "base/time/time.h"
     12 #include "ui/views/window/dialog_delegate.h"
     13 
     14 class GURL;
     15 
     16 namespace content {
     17 class WebContents;
     18 }
     19 
     20 namespace views {
     21 class MessageBoxView;
     22 }
     23 
     24 // An external protocol dialog for ChromeOS. Unlike other platforms,
     25 // ChromeOS does not support launching external program, therefore,
     26 // this dialog simply says it is not supported.
     27 class ExternalProtocolDialog : public views::DialogDelegate {
     28  public:
     29   // RunExternalProtocolDialog calls this private constructor.
     30   ExternalProtocolDialog(content::WebContents* web_contents, const GURL& url);
     31 
     32   virtual ~ExternalProtocolDialog();
     33 
     34   // views::DialogDelegate Methods:
     35   virtual int GetDialogButtons() const OVERRIDE;
     36   virtual base::string16 GetDialogButtonLabel(
     37       ui::DialogButton button) const OVERRIDE;
     38   virtual base::string16 GetWindowTitle() const OVERRIDE;
     39   virtual void DeleteDelegate() OVERRIDE;
     40   virtual bool Accept() OVERRIDE;
     41   virtual views::View* GetContentsView() OVERRIDE;
     42 
     43   // views::WidgetDelegate Methods:
     44   virtual const views::Widget* GetWidget() const OVERRIDE;
     45   virtual views::Widget* GetWidget() OVERRIDE;
     46 
     47  private:
     48   // The message box view whose commands we handle.
     49   views::MessageBoxView* message_box_view_;
     50 
     51   // The time at which this dialog was created.
     52   base::TimeTicks creation_time_;
     53 
     54   // The scheme of the url.
     55   std::string scheme_;
     56 
     57   DISALLOW_COPY_AND_ASSIGN(ExternalProtocolDialog);
     58 };
     59 
     60 #endif  // CHROME_BROWSER_CHROMEOS_EXTERNAL_PROTOCOL_DIALOG_H_
     61