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/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 Loading... |
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 Loading... |
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 } |
OLD | NEW |