OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_DIALOG_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_DIALOG_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_DIALOG_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_DIALOG_H_ |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 // Sets the window title. | 58 // Sets the window title. |
59 void set_title(const base::string16& title) { window_title_ = title; } | 59 void set_title(const base::string16& title) { window_title_ = title; } |
60 | 60 |
61 // Sets minimum contents size in pixels and makes the window resizable. | 61 // Sets minimum contents size in pixels and makes the window resizable. |
62 void SetMinimumContentsSize(int width, int height); | 62 void SetMinimumContentsSize(int width, int height); |
63 | 63 |
64 extensions::ExtensionViewHost* host() const { return host_.get(); } | 64 extensions::ExtensionViewHost* host() const { return host_.get(); } |
65 | 65 |
66 // views::DialogDelegate override. | 66 // views::DialogDelegate override. |
67 virtual int GetDialogButtons() const OVERRIDE; | 67 virtual int GetDialogButtons() const override; |
68 virtual bool CanResize() const OVERRIDE; | 68 virtual bool CanResize() const override; |
69 virtual ui::ModalType GetModalType() const OVERRIDE; | 69 virtual ui::ModalType GetModalType() const override; |
70 virtual bool ShouldShowWindowTitle() const OVERRIDE; | 70 virtual bool ShouldShowWindowTitle() const override; |
71 virtual base::string16 GetWindowTitle() const OVERRIDE; | 71 virtual base::string16 GetWindowTitle() const override; |
72 virtual void WindowClosing() OVERRIDE; | 72 virtual void WindowClosing() override; |
73 virtual void DeleteDelegate() OVERRIDE; | 73 virtual void DeleteDelegate() override; |
74 virtual views::Widget* GetWidget() OVERRIDE; | 74 virtual views::Widget* GetWidget() override; |
75 virtual const views::Widget* GetWidget() const OVERRIDE; | 75 virtual const views::Widget* GetWidget() const override; |
76 virtual views::View* GetContentsView() OVERRIDE; | 76 virtual views::View* GetContentsView() override; |
77 virtual bool UseNewStyleForThisDialog() const OVERRIDE; | 77 virtual bool UseNewStyleForThisDialog() const override; |
78 | 78 |
79 // content::NotificationObserver overrides. | 79 // content::NotificationObserver overrides. |
80 virtual void Observe(int type, | 80 virtual void Observe(int type, |
81 const content::NotificationSource& source, | 81 const content::NotificationSource& source, |
82 const content::NotificationDetails& details) OVERRIDE; | 82 const content::NotificationDetails& details) override; |
83 | 83 |
84 protected: | 84 protected: |
85 virtual ~ExtensionDialog(); | 85 virtual ~ExtensionDialog(); |
86 | 86 |
87 private: | 87 private: |
88 friend class base::RefCounted<ExtensionDialog>; | 88 friend class base::RefCounted<ExtensionDialog>; |
89 | 89 |
90 // Use Show() to create instances. | 90 // Use Show() to create instances. |
91 ExtensionDialog(extensions::ExtensionViewHost* host, | 91 ExtensionDialog(extensions::ExtensionViewHost* host, |
92 ExtensionDialogObserver* observer); | 92 ExtensionDialogObserver* observer); |
93 | 93 |
94 void InitWindow(aura::Window* parent_window, int width, int height); | 94 void InitWindow(aura::Window* parent_window, int width, int height); |
95 | 95 |
96 // Window Title | 96 // Window Title |
97 base::string16 window_title_; | 97 base::string16 window_title_; |
98 | 98 |
99 // The contained host for the view. | 99 // The contained host for the view. |
100 scoped_ptr<extensions::ExtensionViewHost> host_; | 100 scoped_ptr<extensions::ExtensionViewHost> host_; |
101 | 101 |
102 content::NotificationRegistrar registrar_; | 102 content::NotificationRegistrar registrar_; |
103 | 103 |
104 // The observer of this popup. | 104 // The observer of this popup. |
105 ExtensionDialogObserver* observer_; | 105 ExtensionDialogObserver* observer_; |
106 | 106 |
107 DISALLOW_COPY_AND_ASSIGN(ExtensionDialog); | 107 DISALLOW_COPY_AND_ASSIGN(ExtensionDialog); |
108 }; | 108 }; |
109 | 109 |
110 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_DIALOG_H_ | 110 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_DIALOG_H_ |
OLD | NEW |