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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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; |
284 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 285 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
285 params.parent = browser_view_->GetWidget()->GetNativeView(); | 286 params.parent = browser_view_->GetWidget()->GetNativeView(); |
286 params.bounds = GetPopupRect(false); | 287 params.bounds = GetPopupRect(false); |
287 popup_->Init(params); | 288 popup_->Init(params); |
288 gfx::Size size = GetPopupRect(true).size(); | 289 gfx::Size size = GetPopupRect(true).size(); |
289 popup_->SetContentsView(view_); | 290 popup_->SetContentsView(view_); |
290 // We set layout manager to NULL to prevent the widget from sizing its | 291 // 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 | 292 // 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 | 293 // shrinking while we animate the height of the popup to give the impression |
293 // that it is sliding off the top of the screen. | 294 // that it is sliding off the top of the screen. |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 const content::NotificationDetails& details) { | 506 const content::NotificationDetails& details) { |
506 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); | 507 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); |
507 UpdateForImmersiveState(); | 508 UpdateForImmersiveState(); |
508 } | 509 } |
509 | 510 |
510 void FullscreenExitBubbleViews::OnWidgetVisibilityChanged( | 511 void FullscreenExitBubbleViews::OnWidgetVisibilityChanged( |
511 views::Widget* widget, | 512 views::Widget* widget, |
512 bool visible) { | 513 bool visible) { |
513 UpdateMouseWatcher(); | 514 UpdateMouseWatcher(); |
514 } | 515 } |
OLD | NEW |