| 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/devtools/devtools_window.h" | 9 #include "chrome/browser/devtools/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/extensions/extension_system.h" |
| 12 #include "chrome/browser/platform_util.h" | 12 #include "chrome/browser/platform_util.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/ui/browser_window.h" | 15 #include "chrome/browser/ui/browser_window.h" |
| 16 #include "chrome/common/chrome_notification_types.h" | 16 #include "chrome/common/chrome_notification_types.h" |
| 17 #include "content/public/browser/notification_details.h" | 17 #include "content/public/browser/notification_details.h" |
| 18 #include "content/public/browser/notification_source.h" | 18 #include "content/public/browser/notification_source.h" |
| 19 #include "content/public/browser/render_view_host.h" | 19 #include "content/public/browser/render_view_host.h" |
| 20 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
| 21 #include "content/public/browser/web_contents_view.h" |
| 21 #include "ui/gfx/insets.h" | 22 #include "ui/gfx/insets.h" |
| 22 #include "ui/views/layout/fill_layout.h" | 23 #include "ui/views/layout/fill_layout.h" |
| 23 #include "ui/views/widget/widget.h" | 24 #include "ui/views/widget/widget.h" |
| 24 | 25 |
| 25 #if defined(USE_AURA) | 26 #if defined(USE_AURA) |
| 26 #include "ui/aura/window.h" | 27 #include "ui/aura/window.h" |
| 27 #include "ui/views/corewm/window_animations.h" | 28 #include "ui/views/corewm/window_animations.h" |
| 28 #endif | 29 #endif |
| 29 | 30 |
| 30 using content::RenderViewHost; | 31 using content::RenderViewHost; |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 } | 204 } |
| 204 | 205 |
| 205 void ExtensionPopup::ShowBubble() { | 206 void ExtensionPopup::ShowBubble() { |
| 206 Show(); | 207 Show(); |
| 207 | 208 |
| 208 // Request focus for the View. Without this, the FocusManager gets confused. | 209 // Request focus for the View. Without this, the FocusManager gets confused. |
| 209 host()->view()->SetVisible(true); | 210 host()->view()->SetVisible(true); |
| 210 host()->view()->RequestFocus(); | 211 host()->view()->RequestFocus(); |
| 211 | 212 |
| 212 // Focus on the host contents when the bubble is first shown. | 213 // Focus on the host contents when the bubble is first shown. |
| 213 host()->host_contents()->Focus(); | 214 host()->host_contents()->GetView()->Focus(); |
| 214 | 215 |
| 215 // Listen for widget focus changes after showing (used for non-aura win). | 216 // Listen for widget focus changes after showing (used for non-aura win). |
| 216 views::WidgetFocusManager::GetInstance()->AddFocusChangeListener(this); | 217 views::WidgetFocusManager::GetInstance()->AddFocusChangeListener(this); |
| 217 | 218 |
| 218 if (inspect_with_devtools_) { | 219 if (inspect_with_devtools_) { |
| 219 DevToolsWindow::ToggleDevToolsWindow(host()->render_view_host(), | 220 DevToolsWindow::ToggleDevToolsWindow(host()->render_view_host(), |
| 220 true, | 221 true, |
| 221 DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE); | 222 DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE); |
| 222 } | 223 } |
| 223 } | 224 } |
| 224 | 225 |
| 225 void ExtensionPopup::CloseBubble() { | 226 void ExtensionPopup::CloseBubble() { |
| 226 GetWidget()->Close(); | 227 GetWidget()->Close(); |
| 227 } | 228 } |
| OLD | NEW |