Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / chromeos / external_protocol_dialog.h
blob78296319238c95d3b3c45bfb6becff72040a0e17
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.
5 #ifndef CHROME_BROWSER_CHROMEOS_EXTERNAL_PROTOCOL_DIALOG_H_
6 #define CHROME_BROWSER_CHROMEOS_EXTERNAL_PROTOCOL_DIALOG_H_
8 #include <string>
10 #include "base/strings/string16.h"
11 #include "base/time/time.h"
12 #include "ui/views/window/dialog_delegate.h"
14 class GURL;
16 namespace content {
17 class WebContents;
20 namespace views {
21 class MessageBoxView;
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);
32 ~ExternalProtocolDialog() override;
34 // views::DialogDelegate Methods:
35 int GetDialogButtons() const override;
36 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
37 base::string16 GetWindowTitle() const override;
38 void DeleteDelegate() override;
39 bool Accept() override;
40 views::View* GetContentsView() override;
42 // views::WidgetDelegate Methods:
43 const views::Widget* GetWidget() const override;
44 views::Widget* GetWidget() override;
46 private:
47 // The message box view whose commands we handle.
48 views::MessageBoxView* message_box_view_;
50 // The time at which this dialog was created.
51 base::TimeTicks creation_time_;
53 // The scheme of the url.
54 std::string scheme_;
56 DISALLOW_COPY_AND_ASSIGN(ExternalProtocolDialog);
59 #endif // CHROME_BROWSER_CHROMEOS_EXTERNAL_PROTOCOL_DIALOG_H_