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

Side by Side Diff: chrome/browser/ui/ash/ash_init.cc

Issue 706013004: Move non-browser specific ScreenshotTaker code to ui/snapshot. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge and fix gn Created 6 years 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 "chrome/browser/ui/ash/ash_init.h" 5 #include "chrome/browser/ui/ash/ash_init.h"
6 6
7 #include "ash/accelerators/accelerator_controller.h" 7 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/accelerometer/accelerometer_controller.h" 8 #include "ash/accelerometer/accelerometer_controller.h"
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/high_contrast/high_contrast_controller.h" 10 #include "ash/high_contrast/high_contrast_controller.h"
11 #include "ash/magnifier/magnification_controller.h" 11 #include "ash/magnifier/magnification_controller.h"
12 #include "ash/magnifier/partial_magnification_controller.h" 12 #include "ash/magnifier/partial_magnification_controller.h"
13 #include "ash/shell.h" 13 #include "ash/shell.h"
14 #include "ash/shell_init_params.h" 14 #include "ash/shell_init_params.h"
15 #include "base/command_line.h" 15 #include "base/command_line.h"
16 #include "chrome/browser/browser_shutdown.h" 16 #include "chrome/browser/browser_shutdown.h"
17 #include "chrome/browser/lifetime/application_lifetime.h" 17 #include "chrome/browser/lifetime/application_lifetime.h"
18 #include "chrome/browser/ui/ash/chrome_screenshot_grabber.h"
18 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" 19 #include "chrome/browser/ui/ash/chrome_shell_delegate.h"
19 #include "chrome/browser/ui/ash/screenshot_taker.h"
20 #include "chrome/common/chrome_switches.h" 20 #include "chrome/common/chrome_switches.h"
21 #include "content/public/browser/browser_thread.h" 21 #include "content/public/browser/browser_thread.h"
22 #include "content/public/browser/context_factory.h" 22 #include "content/public/browser/context_factory.h"
23 #include "ui/aura/env.h" 23 #include "ui/aura/env.h"
24 #include "ui/aura/window_tree_host.h" 24 #include "ui/aura/window_tree_host.h"
25 25
26 #if defined(OS_CHROMEOS) 26 #if defined(OS_CHROMEOS)
27 #include "base/sys_info.h" 27 #include "base/sys_info.h"
28 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 28 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
29 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" 29 #include "chrome/browser/chromeos/accessibility/magnification_manager.h"
(...skipping 25 matching lines...) Expand all
55 ash::ShellInitParams shell_init_params; 55 ash::ShellInitParams shell_init_params;
56 // Shell takes ownership of ChromeShellDelegate. 56 // Shell takes ownership of ChromeShellDelegate.
57 shell_init_params.delegate = new ChromeShellDelegate; 57 shell_init_params.delegate = new ChromeShellDelegate;
58 shell_init_params.context_factory = content::GetContextFactory(); 58 shell_init_params.context_factory = content::GetContextFactory();
59 #if defined(OS_WIN) 59 #if defined(OS_WIN)
60 shell_init_params.remote_hwnd = remote_window; 60 shell_init_params.remote_hwnd = remote_window;
61 #endif 61 #endif
62 62
63 ash::Shell* shell = ash::Shell::CreateInstance(shell_init_params); 63 ash::Shell* shell = ash::Shell::CreateInstance(shell_init_params);
64 shell->accelerator_controller()->SetScreenshotDelegate( 64 shell->accelerator_controller()->SetScreenshotDelegate(
65 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); 65 scoped_ptr<ash::ScreenshotDelegate>(new ChromeScreenshotGrabber).Pass());
66 // TODO(flackr): Investigate exposing a blocking pool task runner to chromeos. 66 // TODO(flackr): Investigate exposing a blocking pool task runner to chromeos.
67 shell->accelerometer_controller()->Initialize( 67 shell->accelerometer_controller()->Initialize(
68 content::BrowserThread::GetBlockingPool()-> 68 content::BrowserThread::GetBlockingPool()->
69 GetTaskRunnerWithShutdownBehavior( 69 GetTaskRunnerWithShutdownBehavior(
70 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); 70 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN));
71 #if defined(OS_CHROMEOS) 71 #if defined(OS_CHROMEOS)
72 shell->accelerator_controller()->SetImeControlDelegate( 72 shell->accelerator_controller()->SetImeControlDelegate(
73 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); 73 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass());
74 shell->high_contrast_controller()->SetEnabled( 74 shell->high_contrast_controller()->SetEnabled(
75 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); 75 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled());
(...skipping 15 matching lines...) Expand all
91 #endif 91 #endif
92 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); 92 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show();
93 } 93 }
94 94
95 void CloseAsh() { 95 void CloseAsh() {
96 if (ash::Shell::HasInstance()) 96 if (ash::Shell::HasInstance())
97 ash::Shell::DeleteInstance(); 97 ash::Shell::DeleteInstance();
98 } 98 }
99 99
100 } // namespace chrome 100 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/policy/policy_browsertest.cc ('k') | chrome/browser/ui/ash/chrome_screenshot_grabber.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698