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" |
11 #include "chrome/browser/extensions/extension_view_host_factory.h" | 11 #include "chrome/browser/extensions/extension_view_host_factory.h" |
12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
13 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 13 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
14 #include "content/public/browser/devtools_agent_host.h" | 14 #include "content/public/browser/devtools_agent_host.h" |
15 #include "content/public/browser/devtools_manager.h" | 15 #include "content/public/browser/devtools_manager.h" |
16 #include "content/public/browser/notification_details.h" | 16 #include "content/public/browser/notification_details.h" |
17 #include "content/public/browser/notification_source.h" | 17 #include "content/public/browser/notification_source.h" |
18 #include "content/public/browser/render_view_host.h" | 18 #include "content/public/browser/render_view_host.h" |
19 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
20 #include "ui/aura/window.h" | 20 #include "ui/aura/window.h" |
21 #include "ui/gfx/insets.h" | 21 #include "ui/gfx/insets.h" |
22 #include "ui/views/layout/fill_layout.h" | 22 #include "ui/views/layout/fill_layout.h" |
23 #include "ui/views/widget/widget.h" | 23 #include "ui/views/widget/widget.h" |
24 #include "ui/wm/core/window_animations.h" | 24 #include "ui/wm/core/window_animations.h" |
25 #include "ui/wm/core/window_util.h" | 25 #include "ui/wm/core/window_util.h" |
26 #include "ui/wm/public/activation_client.h" | 26 #include "ui/wm/public/activation_client.h" |
27 | 27 |
28 #if defined(OS_WIN) | |
29 #include "ui/views/win/hwnd_util.h" | |
30 #endif | |
31 | |
32 // The minimum/maximum dimensions of the popup. | 28 // The minimum/maximum dimensions of the popup. |
33 // The minimum is just a little larger than the size of the button itself. | 29 // The minimum is just a little larger than the size of the button itself. |
34 // The maximum is an arbitrary number that should be smaller than most screens. | 30 // The maximum is an arbitrary number that should be smaller than most screens. |
35 const int ExtensionPopup::kMinWidth = 25; | 31 const int ExtensionPopup::kMinWidth = 25; |
36 const int ExtensionPopup::kMinHeight = 25; | 32 const int ExtensionPopup::kMinHeight = 25; |
37 const int ExtensionPopup::kMaxWidth = 800; | 33 const int ExtensionPopup::kMaxWidth = 800; |
38 const int ExtensionPopup::kMaxHeight = 600; | 34 const int ExtensionPopup::kMaxHeight = 600; |
39 | 35 |
40 ExtensionPopup::ExtensionPopup(extensions::ExtensionViewHost* host, | 36 ExtensionPopup::ExtensionPopup(extensions::ExtensionViewHost* host, |
41 views::View* anchor_view, | 37 views::View* anchor_view, |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 GetWidget()->Show(); | 211 GetWidget()->Show(); |
216 | 212 |
217 // Focus on the host contents when the bubble is first shown. | 213 // Focus on the host contents when the bubble is first shown. |
218 host()->host_contents()->Focus(); | 214 host()->host_contents()->Focus(); |
219 | 215 |
220 if (inspect_with_devtools_) { | 216 if (inspect_with_devtools_) { |
221 DevToolsWindow::OpenDevToolsWindow(host()->render_view_host(), | 217 DevToolsWindow::OpenDevToolsWindow(host()->render_view_host(), |
222 DevToolsToggleAction::ShowConsole()); | 218 DevToolsToggleAction::ShowConsole()); |
223 } | 219 } |
224 } | 220 } |
OLD | NEW |