Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Side by Side Diff: chrome/browser/ui/views/extensions/extension_popup.cc

Issue 10913243: extensions: Add ExtensionView interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 views::BubbleBorder::ArrowLocation arrow_location, 68 views::BubbleBorder::ArrowLocation arrow_location,
69 ShowAction show_action) 69 ShowAction show_action)
70 : BubbleDelegateView(anchor_view, arrow_location), 70 : BubbleDelegateView(anchor_view, arrow_location),
71 extension_host_(host), 71 extension_host_(host),
72 close_bubble_factory_(this) { 72 close_bubble_factory_(this) {
73 inspect_with_devtools_ = show_action == SHOW_AND_INSPECT; 73 inspect_with_devtools_ = show_action == SHOW_AND_INSPECT;
74 // Adjust the margin so that contents fit better. 74 // Adjust the margin so that contents fit better.
75 const int margin = views::BubbleBorder::GetCornerRadius() / 2; 75 const int margin = views::BubbleBorder::GetCornerRadius() / 2;
76 set_margins(gfx::Insets(margin, margin, margin, margin)); 76 set_margins(gfx::Insets(margin, margin, margin, margin));
77 SetLayoutManager(new views::FillLayout()); 77 SetLayoutManager(new views::FillLayout());
78 AddChildView(host->view()); 78 AddChildView(host->extension_view());
79 host->view()->SetContainer(this); 79 host->extension_view()->SetContainer(this);
80 // Use OnNativeFocusChange to check for child window activation on deactivate. 80 // Use OnNativeFocusChange to check for child window activation on deactivate.
81 set_close_on_deactivate(false); 81 set_close_on_deactivate(false);
82 // Make the bubble move with its anchor (during inspection, etc.). 82 // Make the bubble move with its anchor (during inspection, etc.).
83 set_move_with_anchor(true); 83 set_move_with_anchor(true);
84 84
85 // Wait to show the popup until the contained host finishes loading. 85 // Wait to show the popup until the contained host finishes loading.
86 registrar_.Add(this, content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, 86 registrar_.Add(this, content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME,
87 content::Source<WebContents>(host->host_contents())); 87 content::Source<WebContents>(host->host_contents()));
88 88
89 // Listen for the containing view calling window.close(); 89 // Listen for the containing view calling window.close();
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 if (inspect_with_devtools_) { 216 if (inspect_with_devtools_) {
217 DevToolsWindow::ToggleDevToolsWindow(host()->render_view_host(), 217 DevToolsWindow::ToggleDevToolsWindow(host()->render_view_host(),
218 true, 218 true,
219 DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE); 219 DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE);
220 } 220 }
221 } 221 }
222 222
223 void ExtensionPopup::CloseBubble() { 223 void ExtensionPopup::CloseBubble() {
224 GetWidget()->Close(); 224 GetWidget()->Close();
225 } 225 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698