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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/command_updater.h" | 10 #include "chrome/browser/command_updater.h" |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 // A test browser window that can toggle fullscreen state. | 305 // A test browser window that can toggle fullscreen state. |
306 class FullscreenTestBrowserWindow : public TestBrowserWindow { | 306 class FullscreenTestBrowserWindow : public TestBrowserWindow { |
307 public: | 307 public: |
308 FullscreenTestBrowserWindow() : fullscreen_(false) {} | 308 FullscreenTestBrowserWindow() : fullscreen_(false) {} |
309 ~FullscreenTestBrowserWindow() override {} | 309 ~FullscreenTestBrowserWindow() override {} |
310 | 310 |
311 // TestBrowserWindow overrides: | 311 // TestBrowserWindow overrides: |
312 bool ShouldHideUIForFullscreen() const override { return fullscreen_; } | 312 bool ShouldHideUIForFullscreen() const override { return fullscreen_; } |
313 bool IsFullscreen() const override { return fullscreen_; } | 313 bool IsFullscreen() const override { return fullscreen_; } |
314 void EnterFullscreen(const GURL& url, | 314 void EnterFullscreen(const GURL& url, |
315 FullscreenExitBubbleType type, | 315 ExclusiveAccessBubbleType type, |
316 bool with_toolbar) override { | 316 bool with_toolbar) override { |
317 fullscreen_ = true; | 317 fullscreen_ = true; |
318 } | 318 } |
319 void ExitFullscreen() override { fullscreen_ = false; } | 319 void ExitFullscreen() override { fullscreen_ = false; } |
320 | 320 |
321 private: | 321 private: |
322 bool fullscreen_; | 322 bool fullscreen_; |
323 | 323 |
324 DISALLOW_COPY_AND_ASSIGN(FullscreenTestBrowserWindow); | 324 DISALLOW_COPY_AND_ASSIGN(FullscreenTestBrowserWindow); |
325 }; | 325 }; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 | 450 |
451 TEST_F(BrowserCommandControllerTest, OnSigninAllowedPrefChange) { | 451 TEST_F(BrowserCommandControllerTest, OnSigninAllowedPrefChange) { |
452 chrome::BrowserCommandController command_controller(browser()); | 452 chrome::BrowserCommandController command_controller(browser()); |
453 const CommandUpdater* command_updater = command_controller.command_updater(); | 453 const CommandUpdater* command_updater = command_controller.command_updater(); |
454 | 454 |
455 // Check that the SYNC_SETUP command is updated on preference change. | 455 // Check that the SYNC_SETUP command is updated on preference change. |
456 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP)); | 456 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP)); |
457 profile()->GetPrefs()->SetBoolean(prefs::kSigninAllowed, false); | 457 profile()->GetPrefs()->SetBoolean(prefs::kSigninAllowed, false); |
458 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP)); | 458 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP)); |
459 } | 459 } |
OLD | NEW |