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_popup.h" | 5 #include "chrome/browser/ui/views/extensions/extension_popup.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "chrome/browser/debugger/devtools_window.h" | 9 #include "chrome/browser/debugger/devtools_window.h" |
10 #include "chrome/browser/extensions/extension_process_manager.h" | 10 #include "chrome/browser/extensions/extension_process_manager.h" |
| 11 #include "chrome/browser/extensions/extension_system.h" |
11 #include "chrome/browser/platform_util.h" | 12 #include "chrome/browser/platform_util.h" |
12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
14 #include "chrome/browser/ui/browser_window.h" | 15 #include "chrome/browser/ui/browser_window.h" |
15 #include "chrome/common/chrome_notification_types.h" | 16 #include "chrome/common/chrome_notification_types.h" |
16 #include "content/public/browser/notification_details.h" | 17 #include "content/public/browser/notification_details.h" |
17 #include "content/public/browser/notification_source.h" | 18 #include "content/public/browser/notification_source.h" |
18 #include "content/public/browser/render_view_host.h" | 19 #include "content/public/browser/render_view_host.h" |
19 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
20 #include "ui/gfx/insets.h" | 21 #include "ui/gfx/insets.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 } | 174 } |
174 | 175 |
175 // static | 176 // static |
176 ExtensionPopup* ExtensionPopup::ShowPopup( | 177 ExtensionPopup* ExtensionPopup::ShowPopup( |
177 const GURL& url, | 178 const GURL& url, |
178 Browser* browser, | 179 Browser* browser, |
179 views::View* anchor_view, | 180 views::View* anchor_view, |
180 views::BubbleBorder::ArrowLocation arrow_location, | 181 views::BubbleBorder::ArrowLocation arrow_location, |
181 ShowAction show_action) { | 182 ShowAction show_action) { |
182 ExtensionProcessManager* manager = | 183 ExtensionProcessManager* manager = |
183 browser->profile()->GetExtensionProcessManager(); | 184 extensions::ExtensionSystem::Get(browser->profile())->process_manager(); |
184 extensions::ExtensionHost* host = manager->CreatePopupHost(url, browser); | 185 extensions::ExtensionHost* host = manager->CreatePopupHost(url, browser); |
185 ExtensionPopup* popup = new ExtensionPopup(browser, host, anchor_view, | 186 ExtensionPopup* popup = new ExtensionPopup(browser, host, anchor_view, |
186 arrow_location, show_action); | 187 arrow_location, show_action); |
187 views::BubbleDelegateView::CreateBubble(popup); | 188 views::BubbleDelegateView::CreateBubble(popup); |
188 | 189 |
189 #if defined(USE_ASH) | 190 #if defined(USE_ASH) |
190 gfx::NativeView native_view = popup->GetWidget()->GetNativeView(); | 191 gfx::NativeView native_view = popup->GetWidget()->GetNativeView(); |
191 ash::SetWindowVisibilityAnimationType( | 192 ash::SetWindowVisibilityAnimationType( |
192 native_view, | 193 native_view, |
193 ash::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); | 194 ash::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); |
(...skipping 22 matching lines...) Expand all Loading... |
216 if (inspect_with_devtools_) { | 217 if (inspect_with_devtools_) { |
217 DevToolsWindow::ToggleDevToolsWindow(host()->render_view_host(), | 218 DevToolsWindow::ToggleDevToolsWindow(host()->render_view_host(), |
218 true, | 219 true, |
219 DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE); | 220 DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE); |
220 } | 221 } |
221 } | 222 } |
222 | 223 |
223 void ExtensionPopup::CloseBubble() { | 224 void ExtensionPopup::CloseBubble() { |
224 GetWidget()->Close(); | 225 GetWidget()->Close(); |
225 } | 226 } |
OLD | NEW |