Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(696)

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 8571026: Fix fullscreen mode on aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update comment Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/test/base/in_process_browser_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 765
766 bool BrowserView::IsMinimized() const { 766 bool BrowserView::IsMinimized() const {
767 return frame_->IsMinimized(); 767 return frame_->IsMinimized();
768 } 768 }
769 769
770 void BrowserView::EnterFullscreen( 770 void BrowserView::EnterFullscreen(
771 const GURL& url, FullscreenExitBubbleType bubble_type) { 771 const GURL& url, FullscreenExitBubbleType bubble_type) {
772 if (IsFullscreen()) 772 if (IsFullscreen())
773 return; // Nothing to do. 773 return; // Nothing to do.
774 774
775 #if defined(OS_WIN) 775 #if defined(OS_WIN) || defined(USE_AURA)
776 ProcessFullscreen(true, url, bubble_type); 776 ProcessFullscreen(true, url, bubble_type);
777 #else 777 #else
778 // On Linux changing fullscreen is async. Ask the window to change it's 778 // On Linux/gtk changing fullscreen is async. Ask the window to change it's
779 // fullscreen state, and when done invoke ProcessFullscreen. 779 // fullscreen state, and when done invoke ProcessFullscreen.
780 fullscreen_request_.pending = true; 780 fullscreen_request_.pending = true;
781 fullscreen_request_.url = url; 781 fullscreen_request_.url = url;
782 fullscreen_request_.bubble_type = bubble_type; 782 fullscreen_request_.bubble_type = bubble_type;
783 frame_->SetFullscreen(true); 783 frame_->SetFullscreen(true);
784 #endif 784 #endif
785 } 785 }
786 786
787 void BrowserView::ExitFullscreen() { 787 void BrowserView::ExitFullscreen() {
788 if (!IsFullscreen()) 788 if (!IsFullscreen())
789 return; // Nothing to do. 789 return; // Nothing to do.
790 790
791 #if defined(OS_WIN) 791 #if defined(OS_WIN) || defined(USE_AURA)
792 ProcessFullscreen(false, GURL(), FEB_TYPE_NONE); 792 ProcessFullscreen(false, GURL(), FEB_TYPE_NONE);
793 #else 793 #else
794 fullscreen_request_.pending = false; 794 fullscreen_request_.pending = false;
795 // On Linux changing fullscreen is async. Ask the window to change it's 795 // On Linux changing fullscreen is async. Ask the window to change it's
796 // fullscreen state, and when done invoke ProcessFullscreen. 796 // fullscreen state, and when done invoke ProcessFullscreen.
797 frame_->SetFullscreen(false); 797 frame_->SetFullscreen(false);
798 #endif 798 #endif
799 } 799 }
800 800
801 void BrowserView::UpdateFullscreenExitBubbleContent( 801 void BrowserView::UpdateFullscreenExitBubbleContent(
(...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after
2238 omnibox_view->set_force_hidden(true); 2238 omnibox_view->set_force_hidden(true);
2239 ShowWindow(omnibox_view->m_hWnd, SW_HIDE); 2239 ShowWindow(omnibox_view->m_hWnd, SW_HIDE);
2240 #endif 2240 #endif
2241 } 2241 }
2242 #if defined(OS_WIN) && !defined(USE_AURA) 2242 #if defined(OS_WIN) && !defined(USE_AURA)
2243 static_cast<views::NativeWidgetWin*>(frame_->native_widget())-> 2243 static_cast<views::NativeWidgetWin*>(frame_->native_widget())->
2244 PushForceHidden(); 2244 PushForceHidden();
2245 #endif 2245 #endif
2246 2246
2247 // Toggle fullscreen mode. 2247 // Toggle fullscreen mode.
2248 #if defined(OS_WIN) && !defined(USE_AURA) 2248 #if defined(OS_WIN) || defined(USE_AURA)
2249 frame_->SetFullscreen(fullscreen); 2249 frame_->SetFullscreen(fullscreen);
2250 #endif // No need to invoke SetFullscreen for linux as this code is executed 2250 #endif // No need to invoke SetFullscreen for linux/gtk as this code
2251 // once we're already fullscreen on linux. 2251 // is executed once we're already fullscreen on linux.
2252 2252
2253 browser_->WindowFullscreenStateChanged(); 2253 browser_->WindowFullscreenStateChanged();
2254 2254
2255 if (fullscreen) { 2255 if (fullscreen) {
2256 bool is_kiosk = 2256 bool is_kiosk =
2257 CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode); 2257 CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode);
2258 if (!is_kiosk) { 2258 if (!is_kiosk) {
2259 fullscreen_bubble_.reset(new FullscreenExitBubbleViews( 2259 fullscreen_bubble_.reset(new FullscreenExitBubbleViews(
2260 GetWidget(), browser_.get(), url, bubble_type)); 2260 GetWidget(), browser_.get(), url, bubble_type));
2261 } 2261 }
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
2599 Bubble::Show(this->GetWidget(), bounds, views::BubbleBorder::TOP_RIGHT, 2599 Bubble::Show(this->GetWidget(), bounds, views::BubbleBorder::TOP_RIGHT,
2600 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, 2600 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE,
2601 bubble_view, bubble_view); 2601 bubble_view, bubble_view);
2602 } 2602 }
2603 2603
2604 void BrowserView::ShowAvatarBubbleFromAvatarButton() { 2604 void BrowserView::ShowAvatarBubbleFromAvatarButton() {
2605 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); 2605 AvatarMenuButton* button = frame_->GetAvatarMenuButton();
2606 if (button) 2606 if (button)
2607 button->ShowAvatarBubble(); 2607 button->ShowAvatarBubble();
2608 } 2608 }
OLDNEW
« no previous file with comments | « no previous file | chrome/test/base/in_process_browser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698