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

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

Issue 286733002: [Refactor] Consolidate the logic for whether a widget can be activated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 view_ = new FullscreenExitView( 274 view_ = new FullscreenExitView(
275 this, accelerator.GetShortcutText(), url, bubble_type_); 275 this, accelerator.GetShortcutText(), url, bubble_type_);
276 276
277 // TODO(yzshen): Change to use the new views bubble, BubbleDelegateView. 277 // TODO(yzshen): Change to use the new views bubble, BubbleDelegateView.
278 // TODO(pkotwicz): When this becomes a views bubble, make sure that this 278 // TODO(pkotwicz): When this becomes a views bubble, make sure that this
279 // bubble is ignored by ImmersiveModeControllerAsh::BubbleManager. 279 // bubble is ignored by ImmersiveModeControllerAsh::BubbleManager.
280 // Initialize the popup. 280 // Initialize the popup.
281 popup_ = new views::Widget; 281 popup_ = new views::Widget;
282 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); 282 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
283 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 283 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
284 params.can_activate = false;
285 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 284 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
286 params.parent = browser_view_->GetWidget()->GetNativeView(); 285 params.parent = browser_view_->GetWidget()->GetNativeView();
287 params.bounds = GetPopupRect(false); 286 params.bounds = GetPopupRect(false);
288 popup_->Init(params); 287 popup_->Init(params);
289 gfx::Size size = GetPopupRect(true).size(); 288 gfx::Size size = GetPopupRect(true).size();
290 popup_->SetContentsView(view_); 289 popup_->SetContentsView(view_);
291 // 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
292 // 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
293 // 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
294 // that it is sliding off the top of the screen. 293 // that it is sliding off the top of the screen.
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 const content::NotificationDetails& details) { 505 const content::NotificationDetails& details) {
507 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); 506 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type);
508 UpdateForImmersiveState(); 507 UpdateForImmersiveState();
509 } 508 }
510 509
511 void FullscreenExitBubbleViews::OnWidgetVisibilityChanged( 510 void FullscreenExitBubbleViews::OnWidgetVisibilityChanged(
512 views::Widget* widget, 511 views::Widget* widget,
513 bool visible) { 512 bool visible) {
514 UpdateMouseWatcher(); 513 UpdateMouseWatcher();
515 } 514 }
OLDNEW
« no previous file with comments | « chrome/browser/first_run/try_chrome_dialog_view.cc ('k') | chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698