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