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

Side by Side Diff: chrome/browser/ui/exclusive_access/exclusive_access_manager.cc

Issue 1252503007: Added flag simplified-fullscreen-ui. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added link to discussion bug 515747. Created 5 years, 4 months 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
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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/exclusive_access/exclusive_access_manager.h" 5 #include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h"
6 6
7 #include "base/command_line.h"
7 #include "chrome/browser/app_mode/app_mode_utils.h" 8 #include "chrome/browser/app_mode/app_mode_utils.h"
8 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_window.h" 10 #include "chrome/browser/ui/browser_window.h"
10 #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" 11 #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h"
11 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" 12 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h"
12 #include "chrome/browser/ui/exclusive_access/mouse_lock_controller.h" 13 #include "chrome/browser/ui/exclusive_access/mouse_lock_controller.h"
14 #include "chrome/common/chrome_switches.h"
13 15
14 using content::WebContents; 16 using content::WebContents;
15 17
16 ExclusiveAccessManager::ExclusiveAccessManager( 18 ExclusiveAccessManager::ExclusiveAccessManager(
17 ExclusiveAccessContext* exclusive_access_context) 19 ExclusiveAccessContext* exclusive_access_context)
18 : exclusive_access_context_(exclusive_access_context), 20 : exclusive_access_context_(exclusive_access_context),
19 fullscreen_controller_(this), 21 fullscreen_controller_(this),
20 mouse_lock_controller_(this) { 22 mouse_lock_controller_(this) {
21 } 23 }
22 24
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 url, bubble_type); 79 url, bubble_type);
78 } 80 }
79 81
80 GURL ExclusiveAccessManager::GetExclusiveAccessBubbleURL() const { 82 GURL ExclusiveAccessManager::GetExclusiveAccessBubbleURL() const {
81 GURL result = fullscreen_controller_.GetURLForExclusiveAccessBubble(); 83 GURL result = fullscreen_controller_.GetURLForExclusiveAccessBubble();
82 if (!result.is_valid()) 84 if (!result.is_valid())
83 result = mouse_lock_controller_.GetURLForExclusiveAccessBubble(); 85 result = mouse_lock_controller_.GetURLForExclusiveAccessBubble();
84 return result; 86 return result;
85 } 87 }
86 88
89 // static
90 bool ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled() {
91 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
92 switches::kEnableSimplifiedFullscreenUI)) {
93 return true;
94 }
95
96 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
97 switches::kDisableSimplifiedFullscreenUI)) {
98 return false;
99 }
100
101 return false;
102 }
103
87 void ExclusiveAccessManager::OnTabDeactivated(WebContents* web_contents) { 104 void ExclusiveAccessManager::OnTabDeactivated(WebContents* web_contents) {
88 fullscreen_controller_.OnTabDeactivated(web_contents); 105 fullscreen_controller_.OnTabDeactivated(web_contents);
89 mouse_lock_controller_.OnTabDeactivated(web_contents); 106 mouse_lock_controller_.OnTabDeactivated(web_contents);
90 } 107 }
91 108
92 void ExclusiveAccessManager::OnTabDetachedFromView(WebContents* web_contents) { 109 void ExclusiveAccessManager::OnTabDetachedFromView(WebContents* web_contents) {
93 fullscreen_controller_.OnTabDetachedFromView(web_contents); 110 fullscreen_controller_.OnTabDetachedFromView(web_contents);
94 mouse_lock_controller_.OnTabDetachedFromView(web_contents); 111 mouse_lock_controller_.OnTabDetachedFromView(web_contents);
95 } 112 }
96 113
(...skipping 21 matching lines...) Expand all
118 bool updateBubble = mouse_lock_controller_.OnDenyExclusiveAccessPermission(); 135 bool updateBubble = mouse_lock_controller_.OnDenyExclusiveAccessPermission();
119 updateBubble |= fullscreen_controller_.OnDenyExclusiveAccessPermission(); 136 updateBubble |= fullscreen_controller_.OnDenyExclusiveAccessPermission();
120 if (updateBubble) 137 if (updateBubble)
121 UpdateExclusiveAccessExitBubbleContent(); 138 UpdateExclusiveAccessExitBubbleContent();
122 } 139 }
123 140
124 void ExclusiveAccessManager::ExitExclusiveAccess() { 141 void ExclusiveAccessManager::ExitExclusiveAccess() {
125 fullscreen_controller_.ExitExclusiveAccessToPreviousState(); 142 fullscreen_controller_.ExitExclusiveAccessToPreviousState();
126 mouse_lock_controller_.LostMouseLock(); 143 mouse_lock_controller_.LostMouseLock();
127 } 144 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698