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.h" | 7 #include "base/message_loop.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" | 10 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 // This is tricky. We may be in an ATL message handler stack, in which case | 315 // This is tricky. We may be in an ATL message handler stack, in which case |
316 // the popup cannot be deleted yet. We also can't set the popup's ownership | 316 // the popup cannot be deleted yet. We also can't set the popup's ownership |
317 // model to NATIVE_WIDGET_OWNS_WIDGET because if the user closed the last tab | 317 // model to NATIVE_WIDGET_OWNS_WIDGET because if the user closed the last tab |
318 // while in fullscreen mode, Windows has already destroyed the popup HWND by | 318 // while in fullscreen mode, Windows has already destroyed the popup HWND by |
319 // the time we get here, and thus either the popup will already have been | 319 // the time we get here, and thus either the popup will already have been |
320 // deleted (if we set this in our constructor) or the popup will never get | 320 // deleted (if we set this in our constructor) or the popup will never get |
321 // another OnFinalMessage() call (if not, as currently). So instead, we tell | 321 // another OnFinalMessage() call (if not, as currently). So instead, we tell |
322 // the popup to synchronously hide, and then asynchronously close and delete | 322 // the popup to synchronously hide, and then asynchronously close and delete |
323 // itself. | 323 // itself. |
324 popup_->Close(); | 324 popup_->Close(); |
325 MessageLoop::current()->DeleteSoon(FROM_HERE, popup_); | 325 base::MessageLoop::current()->DeleteSoon(FROM_HERE, popup_); |
326 } | 326 } |
327 | 327 |
328 void FullscreenExitBubbleViews::UpdateContent( | 328 void FullscreenExitBubbleViews::UpdateContent( |
329 const GURL& url, | 329 const GURL& url, |
330 FullscreenExitBubbleType bubble_type) { | 330 FullscreenExitBubbleType bubble_type) { |
331 DCHECK_NE(FEB_TYPE_NONE, bubble_type); | 331 DCHECK_NE(FEB_TYPE_NONE, bubble_type); |
332 if (bubble_type_ == bubble_type && url_ == url) | 332 if (bubble_type_ == bubble_type && url_ == url) |
333 return; | 333 return; |
334 | 334 |
335 url_ = url; | 335 url_ = url; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 const content::NotificationDetails& details) { | 514 const content::NotificationDetails& details) { |
515 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); | 515 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); |
516 UpdateForImmersiveState(); | 516 UpdateForImmersiveState(); |
517 } | 517 } |
518 | 518 |
519 void FullscreenExitBubbleViews::OnWidgetVisibilityChanged( | 519 void FullscreenExitBubbleViews::OnWidgetVisibilityChanged( |
520 views::Widget* widget, | 520 views::Widget* widget, |
521 bool visible) { | 521 bool visible) { |
522 UpdateMouseWatcher(); | 522 UpdateMouseWatcher(); |
523 } | 523 } |
OLD | NEW |