OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "chrome/browser/ui/views/extensions/extension_view.h" | 10 #include "chrome/browser/ui/views/extensions/extension_view.h" |
11 #include "content/common/notification_observer.h" | 11 #include "content/common/notification_observer.h" |
12 #include "content/common/notification_registrar.h" | 12 #include "content/common/notification_registrar.h" |
13 #include "views/widget/widget_delegate.h" | 13 #include "views/widget/widget_delegate.h" |
14 | 14 |
15 class Browser; | 15 class Browser; |
16 class ExtensionDialogObserver; | 16 class ExtensionDialogObserver; |
17 class ExtensionHost; | 17 class ExtensionHost; |
18 class GURL; | 18 class GURL; |
19 class Profile; | 19 class Profile; |
| 20 class TabContents; |
20 | 21 |
21 namespace views { | 22 namespace views { |
22 class View; | 23 class View; |
23 class Widget; | 24 class Widget; |
24 } | 25 } |
25 | 26 |
26 // Modal dialog containing contents provided by an extension. | 27 // Modal dialog containing contents provided by an extension. |
27 // Dialog is automatically centered in the browser window and has fixed size. | 28 // Dialog is automatically centered in the browser window and has fixed size. |
28 // For example, used by the Chrome OS file browser. | 29 // For example, used by the Chrome OS file browser. |
29 class ExtensionDialog : public views::WidgetDelegate, | 30 class ExtensionDialog : public views::WidgetDelegate, |
30 public ExtensionView::Container, | 31 public ExtensionView::Container, |
31 public NotificationObserver, | 32 public NotificationObserver, |
32 public base::RefCounted<ExtensionDialog> { | 33 public base::RefCounted<ExtensionDialog> { |
33 public: | 34 public: |
34 virtual ~ExtensionDialog(); | 35 virtual ~ExtensionDialog(); |
35 | 36 |
36 // Create and show a dialog with |url| centered over the browser window. | 37 // Create and show a dialog with |url| centered over the browser window. |
37 // |browser| is the browser to which the pop-up will be attached. | 38 // |browser| is the browser to which the pop-up will be attached. |
| 39 // |tab_contents| is the tab that spawned the dialog. |
38 // |width| and |height| are the size of the dialog in pixels. | 40 // |width| and |height| are the size of the dialog in pixels. |
39 static ExtensionDialog* Show(const GURL& url, Browser* browser, | 41 static ExtensionDialog* Show(const GURL& url, Browser* browser, |
| 42 TabContents* tab_contents, |
40 int width, | 43 int width, |
41 int height, | 44 int height, |
42 ExtensionDialogObserver* observer); | 45 ExtensionDialogObserver* observer); |
43 | 46 |
44 // Notifies the dialog that the observer has been destroyed and should not | 47 // Notifies the dialog that the observer has been destroyed and should not |
45 // be sent notifications. | 48 // be sent notifications. |
46 void ObserverDestroyed(); | 49 void ObserverDestroyed(); |
47 | 50 |
48 // Closes the ExtensionDialog. | 51 // Closes the ExtensionDialog. |
49 void Close(); | 52 void Close(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 85 |
83 NotificationRegistrar registrar_; | 86 NotificationRegistrar registrar_; |
84 | 87 |
85 // The observer of this popup. | 88 // The observer of this popup. |
86 ExtensionDialogObserver* observer_; | 89 ExtensionDialogObserver* observer_; |
87 | 90 |
88 DISALLOW_COPY_AND_ASSIGN(ExtensionDialog); | 91 DISALLOW_COPY_AND_ASSIGN(ExtensionDialog); |
89 }; | 92 }; |
90 | 93 |
91 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_DIALOG_H_ | 94 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_DIALOG_H_ |
OLD | NEW |