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

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

Issue 2752593008: Move AcceleratorController from WmShell to Shell (Closed)
Patch Set: fix include 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>
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 #include "testing/gtest/include/gtest/gtest.h" 189 #include "testing/gtest/include/gtest/gtest.h"
190 #include "third_party/WebKit/public/platform/WebInputEvent.h" 190 #include "third_party/WebKit/public/platform/WebInputEvent.h"
191 #include "ui/base/l10n/l10n_util.h" 191 #include "ui/base/l10n/l10n_util.h"
192 #include "ui/base/page_transition_types.h" 192 #include "ui/base/page_transition_types.h"
193 #include "ui/base/resource/resource_bundle.h" 193 #include "ui/base/resource/resource_bundle.h"
194 #include "ui/display/manager/display_manager.h" 194 #include "ui/display/manager/display_manager.h"
195 #include "url/gurl.h" 195 #include "url/gurl.h"
196 #include "url/origin.h" 196 #include "url/origin.h"
197 197
198 #if defined(OS_CHROMEOS) 198 #if defined(OS_CHROMEOS)
199 #include "ash/aura/wm_shell_aura.h"
199 #include "ash/common/accelerators/accelerator_controller.h" 200 #include "ash/common/accelerators/accelerator_controller.h"
200 #include "ash/common/accelerators/accelerator_table.h" 201 #include "ash/common/accelerators/accelerator_table.h"
201 #include "ash/common/accessibility_types.h" 202 #include "ash/common/accessibility_types.h"
202 #include "ash/common/wm_shell.h"
203 #include "ash/shell.h" 203 #include "ash/shell.h"
204 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 204 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
205 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" 205 #include "chrome/browser/chromeos/accessibility/magnification_manager.h"
206 #include "chrome/browser/chromeos/arc/arc_session_manager.h" 206 #include "chrome/browser/chromeos/arc/arc_session_manager.h"
207 #include "chrome/browser/chromeos/login/test/js_checker.h" 207 #include "chrome/browser/chromeos/login/test/js_checker.h"
208 #include "chrome/browser/chromeos/system/timezone_resolver_manager.h" 208 #include "chrome/browser/chromeos/system/timezone_resolver_manager.h"
209 #include "chrome/browser/profiles/profile_manager.h" 209 #include "chrome/browser/profiles/profile_manager.h"
210 #include "chrome/browser/ui/ash/chrome_screenshot_grabber.h" 210 #include "chrome/browser/ui/ash/chrome_screenshot_grabber.h"
211 #include "chromeos/audio/cras_audio_handler.h" 211 #include "chromeos/audio/cras_audio_handler.h"
212 #include "chromeos/chromeos_switches.h" 212 #include "chromeos/chromeos_switches.h"
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 }; 680 };
681 681
682 void TestScreenshotFile(bool enabled) { 682 void TestScreenshotFile(bool enabled) {
683 // AddObserver is an ash-specific method, so just replace the screenshot 683 // AddObserver is an ash-specific method, so just replace the screenshot
684 // grabber with one we've created here. 684 // grabber with one we've created here.
685 std::unique_ptr<ChromeScreenshotGrabber> chrome_screenshot_grabber( 685 std::unique_ptr<ChromeScreenshotGrabber> chrome_screenshot_grabber(
686 new ChromeScreenshotGrabber); 686 new ChromeScreenshotGrabber);
687 // ScreenshotGrabber doesn't own this observer, so the observer's lifetime 687 // ScreenshotGrabber doesn't own this observer, so the observer's lifetime
688 // is tied to the test instead. 688 // is tied to the test instead.
689 chrome_screenshot_grabber->screenshot_grabber()->AddObserver(&observer_); 689 chrome_screenshot_grabber->screenshot_grabber()->AddObserver(&observer_);
690 ash::Shell::GetInstance() 690 ash::WmShellAura::Get()
691 ->accelerator_controller_delegate() 691 ->accelerator_controller_delegate()
692 ->SetScreenshotDelegate(std::move(chrome_screenshot_grabber)); 692 ->SetScreenshotDelegate(std::move(chrome_screenshot_grabber));
693 693
694 SetScreenshotPolicy(enabled); 694 SetScreenshotPolicy(enabled);
695 ash::WmShell::Get()->accelerator_controller()->PerformActionIfEnabled( 695 ash::Shell::Get()->accelerator_controller()->PerformActionIfEnabled(
696 ash::TAKE_SCREENSHOT); 696 ash::TAKE_SCREENSHOT);
697 697
698 content::RunMessageLoop(); 698 content::RunMessageLoop();
699 static_cast<ChromeScreenshotGrabber*>( 699 static_cast<ChromeScreenshotGrabber*>(
700 ash::Shell::GetInstance() 700 ash::WmShellAura::Get()
701 ->accelerator_controller_delegate() 701 ->accelerator_controller_delegate()
702 ->screenshot_delegate()) 702 ->screenshot_delegate())
703 ->screenshot_grabber() 703 ->screenshot_grabber()
704 ->RemoveObserver(&observer_); 704 ->RemoveObserver(&observer_);
705 } 705 }
706 #endif 706 #endif
707 707
708 ExtensionService* extension_service() { 708 ExtensionService* extension_service() {
709 extensions::ExtensionSystem* system = 709 extensions::ExtensionSystem* system =
710 extensions::ExtensionSystem::Get(browser()->profile()); 710 extensions::ExtensionSystem::Get(browser()->profile());
(...skipping 3759 matching lines...) Expand 10 before | Expand all | Expand 10 after
4470 4470
4471 SetEmptyPolicy(); 4471 SetEmptyPolicy();
4472 // Policy not set. 4472 // Policy not set.
4473 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); 4473 CheckSystemTimezoneAutomaticDetectionPolicyUnset();
4474 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); 4474 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false));
4475 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); 4475 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests());
4476 } 4476 }
4477 #endif // defined(OS_CHROMEOS) 4477 #endif // defined(OS_CHROMEOS)
4478 4478
4479 } // namespace policy 4479 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698