OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #if defined(TOOLKIT_USES_GTK) | 7 #if defined(TOOLKIT_USES_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
785 #endif | 785 #endif |
786 } | 786 } |
787 | 787 |
788 void BrowserView::ExitFullscreen() { | 788 void BrowserView::ExitFullscreen() { |
789 if (!IsFullscreen()) | 789 if (!IsFullscreen()) |
790 return; // Nothing to do. | 790 return; // Nothing to do. |
791 | 791 |
792 #if defined(OS_WIN) | 792 #if defined(OS_WIN) |
793 ProcessFullscreen(false, GURL(), FEB_TYPE_NONE); | 793 ProcessFullscreen(false, GURL(), FEB_TYPE_NONE); |
794 #else | 794 #else |
795 fullscreen_request_.pending = false; | |
795 // On Linux changing fullscreen is async. Ask the window to change it's | 796 // On Linux changing fullscreen is async. Ask the window to change it's |
796 // fullscreen state, and when done invoke ProcessFullscreen. | 797 // fullscreen state, and when done invoke ProcessFullscreen. |
797 frame_->SetFullscreen(false); | 798 frame_->SetFullscreen(false); |
798 #endif | 799 #endif |
799 } | 800 } |
800 | 801 |
801 void BrowserView::UpdateFullscreenExitBubbleContent( | 802 void BrowserView::UpdateFullscreenExitBubbleContent( |
802 const GURL& url, | 803 const GURL& url, |
803 FullscreenExitBubbleType bubble_type) { | 804 FullscreenExitBubbleType bubble_type) { |
804 if (fullscreen_bubble_.get()) | 805 if (fullscreen_bubble_.get()) |
805 fullscreen_bubble_->UpdateContent(url, bubble_type); | 806 fullscreen_bubble_->UpdateContent(url, bubble_type); |
806 } | 807 } |
807 | 808 |
808 bool BrowserView::IsFullscreen() const { | 809 bool BrowserView::IsFullscreen() const { |
809 return frame_->IsFullscreen(); | 810 return frame_->IsFullscreen(); |
810 } | 811 } |
811 | 812 |
812 bool BrowserView::IsFullscreenBubbleVisible() const { | 813 bool BrowserView::IsFullscreenBubbleVisible() const { |
813 return fullscreen_bubble_.get() ? true : false; | 814 return fullscreen_bubble_.get() ? true : false; |
814 } | 815 } |
815 | 816 |
816 void BrowserView::FullScreenStateChanged() { | 817 void BrowserView::FullScreenStateChanged() { |
817 bool is_fullscreen = IsFullscreen(); | 818 if (IsFullscreen()) { |
818 if (is_fullscreen) { | 819 if (fullscreen_request_.pending) { |
819 DCHECK(fullscreen_request_.pending); | 820 fullscreen_request_.pending = false; |
yzshen1
2011/10/21 21:45:29
I observed fullscreen state change notification th
koz (OOO until 15th September)
2011/10/24 00:57:05
SGTM.
| |
820 fullscreen_request_.pending = false; | 821 ProcessFullscreen(true, fullscreen_request_.url, |
821 ProcessFullscreen(true, fullscreen_request_.url, | 822 fullscreen_request_.bubble_type); |
822 fullscreen_request_.bubble_type); | 823 } else { |
824 ProcessFullscreen(true, GURL(), | |
825 FEB_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION); | |
826 } | |
823 } else { | 827 } else { |
824 ProcessFullscreen(false, GURL(), FEB_TYPE_NONE); | 828 ProcessFullscreen(false, GURL(), FEB_TYPE_NONE); |
825 } | 829 } |
826 } | 830 } |
827 | 831 |
828 void BrowserView::RestoreFocus() { | 832 void BrowserView::RestoreFocus() { |
829 TabContents* selected_tab_contents = GetSelectedTabContents(); | 833 TabContents* selected_tab_contents = GetSelectedTabContents(); |
830 if (selected_tab_contents) | 834 if (selected_tab_contents) |
831 selected_tab_contents->view()->RestoreFocus(); | 835 selected_tab_contents->view()->RestoreFocus(); |
832 } | 836 } |
(...skipping 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2608 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); | 2612 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); |
2609 gfx::Rect bounds; | 2613 gfx::Rect bounds; |
2610 bounds.set_origin(origin); | 2614 bounds.set_origin(origin); |
2611 | 2615 |
2612 AvatarMenuBubbleView* bubble_view = new AvatarMenuBubbleView(browser_.get()); | 2616 AvatarMenuBubbleView* bubble_view = new AvatarMenuBubbleView(browser_.get()); |
2613 // Bubble::Show() takes ownership of the view. | 2617 // Bubble::Show() takes ownership of the view. |
2614 Bubble::Show(this->GetWidget(), bounds, | 2618 Bubble::Show(this->GetWidget(), bounds, |
2615 views::BubbleBorder::TOP_RIGHT, | 2619 views::BubbleBorder::TOP_RIGHT, |
2616 bubble_view, bubble_view); | 2620 bubble_view, bubble_view); |
2617 } | 2621 } |
OLD | NEW |