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

Side by Side Diff: chrome/browser/ui/views/fullscreen_exit_bubble_views.cc

Issue 118283003: Make Widget::Show() creates active windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more ShowInactive() calls Created 6 years, 11 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
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/fullscreen_exit_bubble_views.h" 5 #include "chrome/browser/ui/views/fullscreen_exit_bubble_views.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 params.bounds = GetPopupRect(false); 286 params.bounds = GetPopupRect(false);
287 popup_->Init(params); 287 popup_->Init(params);
288 gfx::Size size = GetPopupRect(true).size(); 288 gfx::Size size = GetPopupRect(true).size();
289 popup_->SetContentsView(view_); 289 popup_->SetContentsView(view_);
290 // We set layout manager to NULL to prevent the widget from sizing its 290 // We set layout manager to NULL to prevent the widget from sizing its
291 // contents to the same size as itself. This prevents the widget contents from 291 // contents to the same size as itself. This prevents the widget contents from
292 // shrinking while we animate the height of the popup to give the impression 292 // shrinking while we animate the height of the popup to give the impression
293 // that it is sliding off the top of the screen. 293 // that it is sliding off the top of the screen.
294 popup_->GetRootView()->SetLayoutManager(NULL); 294 popup_->GetRootView()->SetLayoutManager(NULL);
295 view_->SetBounds(0, 0, size.width(), size.height()); 295 view_->SetBounds(0, 0, size.width(), size.height());
296 popup_->Show(); // This does not activate the popup. 296 popup_->ShowInactive(); // This does not activate the popup.
297 297
298 popup_->AddObserver(this); 298 popup_->AddObserver(this);
299 299
300 registrar_.Add( 300 registrar_.Add(
301 this, 301 this,
302 chrome::NOTIFICATION_FULLSCREEN_CHANGED, 302 chrome::NOTIFICATION_FULLSCREEN_CHANGED,
303 content::Source<FullscreenController>( 303 content::Source<FullscreenController>(
304 browser_view_->browser()->fullscreen_controller())); 304 browser_view_->browser()->fullscreen_controller()));
305 305
306 UpdateForImmersiveState(); 306 UpdateForImmersiveState();
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 const content::NotificationDetails& details) { 505 const content::NotificationDetails& details) {
506 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); 506 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type);
507 UpdateForImmersiveState(); 507 UpdateForImmersiveState();
508 } 508 }
509 509
510 void FullscreenExitBubbleViews::OnWidgetVisibilityChanged( 510 void FullscreenExitBubbleViews::OnWidgetVisibilityChanged(
511 views::Widget* widget, 511 views::Widget* widget,
512 bool visible) { 512 bool visible) {
513 UpdateMouseWatcher(); 513 UpdateMouseWatcher();
514 } 514 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698