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/browser_command_controller.h" | 5 #include "chrome/browser/ui/browser_command_controller.h" |
6 | 6 |
7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/command_updater.h" | 9 #include "chrome/browser/command_updater.h" |
10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 | 184 |
185 ////////////////////////////////////////////////////////////////////////////// | 185 ////////////////////////////////////////////////////////////////////////////// |
186 | 186 |
187 // A test browser window that can toggle fullscreen state. | 187 // A test browser window that can toggle fullscreen state. |
188 class FullscreenTestBrowserWindow : public TestBrowserWindow { | 188 class FullscreenTestBrowserWindow : public TestBrowserWindow { |
189 public: | 189 public: |
190 FullscreenTestBrowserWindow() : fullscreen_(false) {} | 190 FullscreenTestBrowserWindow() : fullscreen_(false) {} |
191 virtual ~FullscreenTestBrowserWindow() {} | 191 virtual ~FullscreenTestBrowserWindow() {} |
192 | 192 |
193 // TestBrowserWindow overrides: | 193 // TestBrowserWindow overrides: |
194 virtual bool ShouldHideUIForFullscreen() const { | 194 virtual bool ShouldHideUIForFullscreen() const OVERRIDE { |
195 return fullscreen_; | 195 return fullscreen_; |
196 } | 196 } |
197 virtual bool IsFullscreen() const OVERRIDE { | 197 virtual bool IsFullscreen() const OVERRIDE { |
198 return fullscreen_; | 198 return fullscreen_; |
199 } | 199 } |
200 virtual void EnterFullscreen( | 200 virtual void EnterFullscreen( |
201 const GURL& url, FullscreenExitBubbleType type) OVERRIDE { | 201 const GURL& url, FullscreenExitBubbleType type) OVERRIDE { |
202 fullscreen_ = true; | 202 fullscreen_ = true; |
203 } | 203 } |
204 virtual void ExitFullscreen() OVERRIDE { | 204 virtual void ExitFullscreen() OVERRIDE { |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 ProfileManager* profile_manager = testing_profile_manager.profile_manager(); | 364 ProfileManager* profile_manager = testing_profile_manager.profile_manager(); |
365 chrome::BrowserCommandController command_controller(browser(), | 365 chrome::BrowserCommandController command_controller(browser(), |
366 profile_manager); | 366 profile_manager); |
367 const CommandUpdater* command_updater = command_controller.command_updater(); | 367 const CommandUpdater* command_updater = command_controller.command_updater(); |
368 | 368 |
369 // Check that the SYNC_SETUP command is updated on preference change. | 369 // Check that the SYNC_SETUP command is updated on preference change. |
370 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP)); | 370 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP)); |
371 profile()->GetPrefs()->SetBoolean(prefs::kSigninAllowed, false); | 371 profile()->GetPrefs()->SetBoolean(prefs::kSigninAllowed, false); |
372 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP)); | 372 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP)); |
373 } | 373 } |
OLD | NEW |