| 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 "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/devtools/devtools_window.h" | 9 #include "chrome/browser/devtools/devtools_window.h" |
| 10 #include "chrome/browser/extensions/extension_view_host.h" | 10 #include "chrome/browser/extensions/extension_view_host.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // No calls are expected if the widget isn't initialized or no longer exists. | 179 // No calls are expected if the widget isn't initialized or no longer exists. |
| 180 CHECK(widget_initialized_); | 180 CHECK(widget_initialized_); |
| 181 CHECK(GetWidget()); | 181 CHECK(GetWidget()); |
| 182 | 182 |
| 183 if (!inspect_with_devtools_) | 183 if (!inspect_with_devtools_) |
| 184 GetWidget()->Close(); | 184 GetWidget()->Close(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 // static | 187 // static |
| 188 ExtensionPopup* ExtensionPopup::ShowPopup( | 188 ExtensionPopup* ExtensionPopup::ShowPopup( |
| 189 scoped_ptr<extensions::ExtensionViewHost> host, | 189 std::unique_ptr<extensions::ExtensionViewHost> host, |
| 190 views::View* anchor_view, | 190 views::View* anchor_view, |
| 191 views::BubbleBorder::Arrow arrow, | 191 views::BubbleBorder::Arrow arrow, |
| 192 ShowAction show_action) { | 192 ShowAction show_action) { |
| 193 return ExtensionPopup::Create( | 193 return ExtensionPopup::Create( |
| 194 host.release(), anchor_view, arrow, show_action); | 194 host.release(), anchor_view, arrow, show_action); |
| 195 } | 195 } |
| 196 | 196 |
| 197 void ExtensionPopup::ShowBubble() { | 197 void ExtensionPopup::ShowBubble() { |
| 198 GetWidget()->Show(); | 198 GetWidget()->Show(); |
| 199 | 199 |
| 200 // Focus on the host contents when the bubble is first shown. | 200 // Focus on the host contents when the bubble is first shown. |
| 201 host()->host_contents()->Focus(); | 201 host()->host_contents()->Focus(); |
| 202 | 202 |
| 203 if (inspect_with_devtools_) { | 203 if (inspect_with_devtools_) { |
| 204 DevToolsWindow::OpenDevToolsWindow(host()->host_contents(), | 204 DevToolsWindow::OpenDevToolsWindow(host()->host_contents(), |
| 205 DevToolsToggleAction::ShowConsole()); | 205 DevToolsToggleAction::ShowConsole()); |
| 206 } | 206 } |
| 207 } | 207 } |
| OLD | NEW |