external_protocol_dialog.h revision c407dc5cd9bdc5668497f21b26b09d988ab439de
1// Copyright (c) 2009 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 "base/time.h"
9#include "views/window/dialog_delegate.h"
10
11class GURL;
12class MessageBoxView;
13class TabContents;
14
15// An external protocol dialog for ChromeOS. Unlike other platforms,
16// ChromeOS does not support launching external program, therefore,
17// this dialog simply says it is not supported.
18class ExternalProtocolDialog : public views::DialogDelegate {
19 public:
20  // RunExternalProtocolDialog calls this private constructor.
21  ExternalProtocolDialog(TabContents* tab_contents, const GURL& url);
22
23  virtual ~ExternalProtocolDialog();
24
25  // views::DialogDelegate Methods:
26  virtual int GetDialogButtons() const;
27  virtual std::wstring GetDialogButtonLabel(
28      MessageBoxFlags::DialogButton button) const;
29  virtual std::wstring GetWindowTitle() const;
30  virtual void DeleteDelegate();
31  virtual bool Accept();
32  virtual views::View* GetContentsView();
33
34  // views::WindowDelegate Methods:
35  virtual bool IsAlwaysOnTop() const { return false; }
36  virtual bool IsModal() const { return false; }
37
38 private:
39  // The message box view whose commands we handle.
40  MessageBoxView* message_box_view_;
41
42  // The time at which this dialog was created.
43  base::TimeTicks creation_time_;
44
45  // The scheme of the url.
46  std::wstring scheme_;
47
48  DISALLOW_COPY_AND_ASSIGN(ExternalProtocolDialog);
49};
50
51#endif  // CHROME_BROWSER_CHROMEOS_EXTERNAL_PROTOCOL_DIALOG_H_
52