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/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 void BrowserView::ExitFullscreen() { | 826 void BrowserView::ExitFullscreen() { |
827 if (!IsFullscreen()) | 827 if (!IsFullscreen()) |
828 return; // Nothing to do. | 828 return; // Nothing to do. |
829 | 829 |
830 ProcessFullscreen(false, GURL(), FEB_TYPE_NONE); | 830 ProcessFullscreen(false, GURL(), FEB_TYPE_NONE); |
831 } | 831 } |
832 | 832 |
833 void BrowserView::UpdateFullscreenExitBubbleContent( | 833 void BrowserView::UpdateFullscreenExitBubbleContent( |
834 const GURL& url, | 834 const GURL& url, |
835 FullscreenExitBubbleType bubble_type) { | 835 FullscreenExitBubbleType bubble_type) { |
836 if (fullscreen_bubble_.get()) | 836 if (bubble_type == FEB_TYPE_NONE) { |
| 837 fullscreen_bubble_.reset(); |
| 838 } else if (fullscreen_bubble_.get()) { |
837 fullscreen_bubble_->UpdateContent(url, bubble_type); | 839 fullscreen_bubble_->UpdateContent(url, bubble_type); |
| 840 } else { |
| 841 fullscreen_bubble_.reset(new FullscreenExitBubbleViews( |
| 842 GetWidget(), browser_.get(), url, bubble_type)); |
| 843 } |
838 } | 844 } |
839 | 845 |
840 bool BrowserView::IsFullscreen() const { | 846 bool BrowserView::IsFullscreen() const { |
841 return frame_->IsFullscreen(); | 847 return frame_->IsFullscreen(); |
842 } | 848 } |
843 | 849 |
844 bool BrowserView::IsFullscreenBubbleVisible() const { | 850 bool BrowserView::IsFullscreenBubbleVisible() const { |
845 return fullscreen_bubble_ != NULL; | 851 return fullscreen_bubble_ != NULL; |
846 } | 852 } |
847 | 853 |
(...skipping 1636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2484 return; | 2490 return; |
2485 | 2491 |
2486 PasswordGenerationBubbleView* bubble = | 2492 PasswordGenerationBubbleView* bubble = |
2487 new PasswordGenerationBubbleView(bounds, | 2493 new PasswordGenerationBubbleView(bounds, |
2488 this, | 2494 this, |
2489 web_contents->GetRenderViewHost()); | 2495 web_contents->GetRenderViewHost()); |
2490 views::BubbleDelegateView::CreateBubble(bubble); | 2496 views::BubbleDelegateView::CreateBubble(bubble); |
2491 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 2497 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
2492 bubble->Show(); | 2498 bubble->Show(); |
2493 } | 2499 } |
OLD | NEW |