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 #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/views/extensions/extension_dialog_observer.h" | 12 #include "chrome/browser/ui/views/extensions/extension_dialog_observer.h" |
13 #include "chrome/browser/ui/views/window.h" | |
14 #include "chrome/common/chrome_notification_types.h" | 13 #include "chrome/common/chrome_notification_types.h" |
15 #include "content/public/browser/notification_details.h" | 14 #include "content/public/browser/notification_details.h" |
16 #include "content/public/browser/notification_source.h" | 15 #include "content/public/browser/notification_source.h" |
17 #include "content/public/browser/render_view_host.h" | 16 #include "content/public/browser/render_view_host.h" |
18 #include "content/public/browser/render_widget_host_view.h" | 17 #include "content/public/browser/render_widget_host_view.h" |
19 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
20 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
21 #include "ui/gfx/screen.h" | 20 #include "ui/gfx/screen.h" |
22 #include "ui/views/background.h" | 21 #include "ui/views/background.h" |
23 #include "ui/views/widget/widget.h" | 22 #include "ui/views/widget/widget.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 return manager->CreateDialogHost(url, browser); | 128 return manager->CreateDialogHost(url, browser); |
130 } | 129 } |
131 | 130 |
132 #if defined(USE_AURA) | 131 #if defined(USE_AURA) |
133 void ExtensionDialog::InitWindowFullscreen() { | 132 void ExtensionDialog::InitWindowFullscreen() { |
134 aura::RootWindow* root_window = ash::Shell::GetRootWindow(); | 133 aura::RootWindow* root_window = ash::Shell::GetRootWindow(); |
135 gfx::Rect screen_rect = | 134 gfx::Rect screen_rect = |
136 gfx::Screen::GetMonitorNearestWindow(root_window).bounds(); | 135 gfx::Screen::GetMonitorNearestWindow(root_window).bounds(); |
137 | 136 |
138 // We want to be the fullscreen topmost child of the root window. | 137 // We want to be the fullscreen topmost child of the root window. |
139 window_ = browser::CreateFramelessViewsWindow(root_window, this); | 138 window_ = new views::Widget; |
| 139 views::Widget::InitParams params( |
| 140 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
| 141 params.delegate = this; |
| 142 params.parent = root_window; |
| 143 window_->Init(params); |
140 window_->StackAtTop(); | 144 window_->StackAtTop(); |
141 window_->SetBounds(screen_rect); | 145 window_->SetBounds(screen_rect); |
142 window_->Show(); | 146 window_->Show(); |
143 | 147 |
144 // TODO(jamescook): Remove redundant call to Activate()? | 148 // TODO(jamescook): Remove redundant call to Activate()? |
145 window_->Activate(); | 149 window_->Activate(); |
146 } | 150 } |
147 #else | 151 #else |
148 void ExtensionDialog::InitWindowFullscreen() { | 152 void ExtensionDialog::InitWindowFullscreen() { |
149 NOTIMPLEMENTED(); | 153 NOTIMPLEMENTED(); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 if (content::Details<ExtensionHost>(host()) != details) | 262 if (content::Details<ExtensionHost>(host()) != details) |
259 return; | 263 return; |
260 if (observer_) | 264 if (observer_) |
261 observer_->ExtensionTerminated(this); | 265 observer_->ExtensionTerminated(this); |
262 break; | 266 break; |
263 default: | 267 default: |
264 NOTREACHED() << L"Received unexpected notification"; | 268 NOTREACHED() << L"Received unexpected notification"; |
265 break; | 269 break; |
266 } | 270 } |
267 } | 271 } |
OLD | NEW |