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

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 2752593008: Move AcceleratorController from WmShell to Shell (Closed)
Patch Set: cleanup Created 3 years, 9 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) 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
11 #include <utility> 11 #include <utility>
12 #include <vector> 12 #include <vector>
13 13
14 #include "ash/accelerators/accelerator_controller_delegate_aura.h" 14 #include "ash/accelerators/accelerator_controller_delegate_aura.h"
15 #include "ash/aura/wm_shell_aura.h"
15 #include "base/bind.h" 16 #include "base/bind.h"
16 #include "base/bind_helpers.h" 17 #include "base/bind_helpers.h"
17 #include "base/callback.h" 18 #include "base/callback.h"
18 #include "base/callback_helpers.h" 19 #include "base/callback_helpers.h"
19 #include "base/command_line.h" 20 #include "base/command_line.h"
20 #include "base/files/file_enumerator.h" 21 #include "base/files/file_enumerator.h"
21 #include "base/files/file_path.h" 22 #include "base/files/file_path.h"
22 #include "base/files/file_util.h" 23 #include "base/files/file_util.h"
23 #include "base/files/scoped_temp_dir.h" 24 #include "base/files/scoped_temp_dir.h"
24 #include "base/macros.h" 25 #include "base/macros.h"
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 }; 681 };
681 682
682 void TestScreenshotFile(bool enabled) { 683 void TestScreenshotFile(bool enabled) {
683 // AddObserver is an ash-specific method, so just replace the screenshot 684 // AddObserver is an ash-specific method, so just replace the screenshot
684 // grabber with one we've created here. 685 // grabber with one we've created here.
685 std::unique_ptr<ChromeScreenshotGrabber> chrome_screenshot_grabber( 686 std::unique_ptr<ChromeScreenshotGrabber> chrome_screenshot_grabber(
686 new ChromeScreenshotGrabber); 687 new ChromeScreenshotGrabber);
687 // ScreenshotGrabber doesn't own this observer, so the observer's lifetime 688 // ScreenshotGrabber doesn't own this observer, so the observer's lifetime
688 // is tied to the test instead. 689 // is tied to the test instead.
689 chrome_screenshot_grabber->screenshot_grabber()->AddObserver(&observer_); 690 chrome_screenshot_grabber->screenshot_grabber()->AddObserver(&observer_);
690 ash::Shell::GetInstance() 691 ash::WmShellAura::Get()
691 ->accelerator_controller_delegate() 692 ->accelerator_controller_delegate()
692 ->SetScreenshotDelegate(std::move(chrome_screenshot_grabber)); 693 ->SetScreenshotDelegate(std::move(chrome_screenshot_grabber));
693 694
694 SetScreenshotPolicy(enabled); 695 SetScreenshotPolicy(enabled);
695 ash::WmShell::Get()->accelerator_controller()->PerformActionIfEnabled( 696 ash::Shell::Get()->accelerator_controller()->PerformActionIfEnabled(
696 ash::TAKE_SCREENSHOT); 697 ash::TAKE_SCREENSHOT);
697 698
698 content::RunMessageLoop(); 699 content::RunMessageLoop();
699 static_cast<ChromeScreenshotGrabber*>( 700 static_cast<ChromeScreenshotGrabber*>(
700 ash::Shell::GetInstance() 701 ash::WmShellAura::Get()
701 ->accelerator_controller_delegate() 702 ->accelerator_controller_delegate()
702 ->screenshot_delegate()) 703 ->screenshot_delegate())
703 ->screenshot_grabber() 704 ->screenshot_grabber()
704 ->RemoveObserver(&observer_); 705 ->RemoveObserver(&observer_);
705 } 706 }
706 #endif 707 #endif
707 708
708 ExtensionService* extension_service() { 709 ExtensionService* extension_service() {
709 extensions::ExtensionSystem* system = 710 extensions::ExtensionSystem* system =
710 extensions::ExtensionSystem::Get(browser()->profile()); 711 extensions::ExtensionSystem::Get(browser()->profile());
(...skipping 3759 matching lines...) Expand 10 before | Expand all | Expand 10 after
4470 4471
4471 SetEmptyPolicy(); 4472 SetEmptyPolicy();
4472 // Policy not set. 4473 // Policy not set.
4473 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); 4474 CheckSystemTimezoneAutomaticDetectionPolicyUnset();
4474 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); 4475 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false));
4475 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); 4476 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests());
4476 } 4477 }
4477 #endif // defined(OS_CHROMEOS) 4478 #endif // defined(OS_CHROMEOS)
4478 4479
4479 } // namespace policy 4480 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698