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 #include "chrome/browser/ui/views/extensions/extension_dialog.h" | 5 #include "chrome/browser/ui/views/extensions/extension_dialog.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_host.h" | 7 #include "chrome/browser/extensions/extension_host.h" |
8 #include "chrome/browser/extensions/extension_process_manager.h" | 8 #include "chrome/browser/extensions/extension_process_manager.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
11 #include "chrome/browser/ui/browser_window.h" | 11 #include "chrome/browser/ui/browser_window.h" |
| 12 #include "chrome/browser/ui/dialog_style.h" |
12 #include "chrome/browser/ui/views/extensions/extension_dialog_observer.h" | 13 #include "chrome/browser/ui/views/extensions/extension_dialog_observer.h" |
13 #include "chrome/browser/ui/views/window.h" // CreateViewsWindow | 14 #include "chrome/browser/ui/views/window.h" // CreateViewsWindow |
14 #include "chrome/common/chrome_notification_types.h" | 15 #include "chrome/common/chrome_notification_types.h" |
15 #include "content/browser/renderer_host/render_view_host.h" | 16 #include "content/browser/renderer_host/render_view_host.h" |
16 #include "content/browser/renderer_host/render_widget_host_view.h" | 17 #include "content/browser/renderer_host/render_widget_host_view.h" |
17 #include "content/browser/tab_contents/tab_contents.h" | 18 #include "content/browser/tab_contents/tab_contents.h" |
18 #include "content/public/browser/notification_details.h" | 19 #include "content/public/browser/notification_details.h" |
19 #include "content/public/browser/notification_source.h" | 20 #include "content/public/browser/notification_source.h" |
20 #include "googleurl/src/gurl.h" | 21 #include "googleurl/src/gurl.h" |
21 #include "views/widget/widget.h" | 22 #include "views/widget/widget.h" |
22 | 23 |
23 #if defined(OS_CHROMEOS) | 24 #if defined(OS_CHROMEOS) |
24 #include "chrome/browser/chromeos/frame/bubble_window.h" | 25 #include "chrome/browser/chromeos/frame/bubble_window.h" |
25 #endif | 26 #endif |
26 | 27 |
27 namespace { | 28 namespace { |
28 | 29 |
29 views::Widget* CreateWindow(gfx::NativeWindow parent, | 30 views::Widget* CreateWindow(gfx::NativeWindow parent, |
30 views::WidgetDelegate* delegate) { | 31 views::WidgetDelegate* delegate) { |
31 #if defined(OS_CHROMEOS) && defined(TOOLKIT_USES_GTK) | 32 #if defined(OS_CHROMEOS) && defined(TOOLKIT_USES_GTK) |
32 // TODO(msw): revert to BubbleWindow for all ChromeOS cases when CL | 33 // TODO(msw): revert to BubbleWindow for all ChromeOS cases when CL |
33 // for crbug.com/98322 is landed. | 34 // for crbug.com/98322 is landed. |
34 // On Chrome OS we need to override the style to suppress padding around | 35 // On Chrome OS we need to override the style to suppress padding around |
35 // the borders. | 36 // the borders. |
36 return chromeos::BubbleWindow::Create(parent, | 37 return chromeos::BubbleWindow::Create(parent, |
37 STYLE_FLUSH, delegate); | 38 STYLE_FLUSH, delegate); |
38 #else | 39 #else |
39 return browser::CreateViewsWindow(parent, delegate); | 40 return browser::CreateViewsWindow(parent, delegate, STYLE_GENERIC); |
40 #endif | 41 #endif |
41 } | 42 } |
42 | 43 |
43 } // namespace | 44 } // namespace |
44 | 45 |
45 ExtensionDialog::ExtensionDialog(ExtensionHost* host, | 46 ExtensionDialog::ExtensionDialog(ExtensionHost* host, |
46 ExtensionDialogObserver* observer) | 47 ExtensionDialogObserver* observer) |
47 : window_(NULL), | 48 : window_(NULL), |
48 extension_host_(host), | 49 extension_host_(host), |
49 observer_(observer) { | 50 observer_(observer) { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 // If we aren't the host of the popup, then disregard the notification. | 168 // If we aren't the host of the popup, then disregard the notification. |
168 if (content::Details<ExtensionHost>(host()) != details) | 169 if (content::Details<ExtensionHost>(host()) != details) |
169 return; | 170 return; |
170 Close(); | 171 Close(); |
171 break; | 172 break; |
172 default: | 173 default: |
173 NOTREACHED() << L"Received unexpected notification"; | 174 NOTREACHED() << L"Received unexpected notification"; |
174 break; | 175 break; |
175 } | 176 } |
176 } | 177 } |
OLD | NEW |