[email protected] | 2a906c0 | 2012-01-06 03:52:12 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 733d0c4 | 2009-10-30 17:58:24 | [diff] [blame] | 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 | |||||
[email protected] | 956b3d3 | 2011-09-28 09:38:48 | [diff] [blame] | 8 | #include <string> |
9 | |||||
avi | 8a07d5389 | 2015-12-24 22:13:53 | [diff] [blame^] | 10 | #include "base/macros.h" |
[email protected] | 5c07332 | 2013-06-11 08:03:30 | [diff] [blame] | 11 | #include "base/strings/string16.h" |
[email protected] | f248ebe0 | 2013-06-28 00:58:28 | [diff] [blame] | 12 | #include "base/time/time.h" |
[email protected] | 4cce6c2 | 2011-11-14 15:32:44 | [diff] [blame] | 13 | #include "ui/views/window/dialog_delegate.h" |
[email protected] | 733d0c4 | 2009-10-30 17:58:24 | [diff] [blame] | 14 | |
15 | class GURL; | ||||
[email protected] | ef9572e | 2012-01-04 22:14:12 | [diff] [blame] | 16 | |
17 | namespace content { | ||||
18 | class WebContents; | ||||
19 | } | ||||
[email protected] | 733d0c4 | 2009-10-30 17:58:24 | [diff] [blame] | 20 | |
[email protected] | 41e5a1d | 2011-03-22 17:26:00 | [diff] [blame] | 21 | namespace views { |
22 | class MessageBoxView; | ||||
23 | } | ||||
24 | |||||
[email protected] | 733d0c4 | 2009-10-30 17:58:24 | [diff] [blame] | 25 | // An external protocol dialog for ChromeOS. Unlike other platforms, |
26 | // ChromeOS does not support launching external program, therefore, | ||||
27 | // this dialog simply says it is not supported. | ||||
28 | class ExternalProtocolDialog : public views::DialogDelegate { | ||||
29 | public: | ||||
30 | // RunExternalProtocolDialog calls this private constructor. | ||||
[email protected] | ef9572e | 2012-01-04 22:14:12 | [diff] [blame] | 31 | ExternalProtocolDialog(content::WebContents* web_contents, const GURL& url); |
[email protected] | 733d0c4 | 2009-10-30 17:58:24 | [diff] [blame] | 32 | |
dcheng | c97a028 | 2015-01-15 23:04:24 | [diff] [blame] | 33 | ~ExternalProtocolDialog() override; |
[email protected] | 733d0c4 | 2009-10-30 17:58:24 | [diff] [blame] | 34 | |
35 | // views::DialogDelegate Methods: | ||||
dcheng | c97a028 | 2015-01-15 23:04:24 | [diff] [blame] | 36 | int GetDialogButtons() const override; |
37 | base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | ||||
38 | base::string16 GetWindowTitle() const override; | ||||
39 | void DeleteDelegate() override; | ||||
40 | bool Accept() override; | ||||
41 | views::View* GetContentsView() override; | ||||
[email protected] | 733d0c4 | 2009-10-30 17:58:24 | [diff] [blame] | 42 | |
[email protected] | 2fdd00a | 2011-06-13 21:56:26 | [diff] [blame] | 43 | // views::WidgetDelegate Methods: |
dcheng | c97a028 | 2015-01-15 23:04:24 | [diff] [blame] | 44 | const views::Widget* GetWidget() const override; |
45 | views::Widget* GetWidget() override; | ||||
[email protected] | 733d0c4 | 2009-10-30 17:58:24 | [diff] [blame] | 46 | |
47 | private: | ||||
48 | // The message box view whose commands we handle. | ||||
[email protected] | 41e5a1d | 2011-03-22 17:26:00 | [diff] [blame] | 49 | views::MessageBoxView* message_box_view_; |
[email protected] | 733d0c4 | 2009-10-30 17:58:24 | [diff] [blame] | 50 | |
51 | // The time at which this dialog was created. | ||||
[email protected] | f691f0e | 2010-05-12 16:43:16 | [diff] [blame] | 52 | base::TimeTicks creation_time_; |
[email protected] | 733d0c4 | 2009-10-30 17:58:24 | [diff] [blame] | 53 | |
54 | // The scheme of the url. | ||||
[email protected] | a65175d | 2010-08-17 04:00:57 | [diff] [blame] | 55 | std::string scheme_; |
[email protected] | 733d0c4 | 2009-10-30 17:58:24 | [diff] [blame] | 56 | |
57 | DISALLOW_COPY_AND_ASSIGN(ExternalProtocolDialog); | ||||
58 | }; | ||||
59 | |||||
60 | #endif // CHROME_BROWSER_CHROMEOS_EXTERNAL_PROTOCOL_DIALOG_H_ |