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

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

Issue 12825007: Revert 173932 "Fix bug where extension popups would not properly..." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 // and not show. This seems to happen in single-process mode. 199 // and not show. This seems to happen in single-process mode.
200 if (host->did_stop_loading()) 200 if (host->did_stop_loading())
201 popup->ShowBubble(); 201 popup->ShowBubble();
202 202
203 return popup; 203 return popup;
204 } 204 }
205 205
206 void ExtensionPopup::ShowBubble() { 206 void ExtensionPopup::ShowBubble() {
207 Show(); 207 Show();
208 208
209 // Request focus for the View. Without this, the FocusManager gets confused.
210 host()->view()->SetVisible(true);
211 host()->view()->RequestFocus();
212
213 // Focus on the host contents when the bubble is first shown. 209 // Focus on the host contents when the bubble is first shown.
214 host()->host_contents()->GetView()->Focus(); 210 host()->host_contents()->GetView()->Focus();
215 211
216 // Listen for widget focus changes after showing (used for non-aura win). 212 // Listen for widget focus changes after showing (used for non-aura win).
217 views::WidgetFocusManager::GetInstance()->AddFocusChangeListener(this); 213 views::WidgetFocusManager::GetInstance()->AddFocusChangeListener(this);
218 214
219 if (inspect_with_devtools_) { 215 if (inspect_with_devtools_) {
220 DevToolsWindow::ToggleDevToolsWindow(host()->render_view_host(), 216 DevToolsWindow::ToggleDevToolsWindow(host()->render_view_host(),
221 true, 217 true,
222 DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE); 218 DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE);
223 } 219 }
224 } 220 }
225 221
226 void ExtensionPopup::CloseBubble() { 222 void ExtensionPopup::CloseBubble() {
227 GetWidget()->Close(); 223 GetWidget()->Close();
228 } 224 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698