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

Side by Side Diff: chrome/browser/ui/ash/palette_delegate_chromeos.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
« no previous file with comments | « chrome/browser/ui/ash/ash_util.cc ('k') | chrome/browser/ui/browser_commands_chromeos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/palette_delegate_chromeos.h" 5 #include "chrome/browser/ui/ash/palette_delegate_chromeos.h"
6 6
7 #include "ash/accelerators/accelerator_controller_delegate_aura.h" 7 #include "ash/accelerators/accelerator_controller_delegate_aura.h"
8 #include "ash/aura/wm_shell_aura.h"
8 #include "ash/common/system/chromeos/palette/palette_utils.h" 9 #include "ash/common/system/chromeos/palette/palette_utils.h"
9 #include "ash/screenshot_delegate.h" 10 #include "ash/screenshot_delegate.h"
10 #include "ash/shell.h" 11 #include "ash/shell.h"
11 #include "ash/utility/screenshot_controller.h" 12 #include "ash/utility/screenshot_controller.h"
12 #include "base/memory/ptr_util.h" 13 #include "base/memory/ptr_util.h"
13 #include "chrome/browser/chrome_notification_types.h" 14 #include "chrome/browser/chrome_notification_types.h"
14 #include "chrome/browser/chromeos/note_taking_helper.h" 15 #include "chrome/browser/chromeos/note_taking_helper.h"
15 #include "chrome/browser/chromeos/profiles/profile_helper.h" 16 #include "chrome/browser/chromeos/profiles/profile_helper.h"
16 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/profiles/profile_manager.h" 18 #include "chrome/browser/profiles/profile_manager.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 126 }
126 127
127 bool PaletteDelegateChromeOS::ShouldShowPalette() { 128 bool PaletteDelegateChromeOS::ShouldShowPalette() {
128 if (!profile_) 129 if (!profile_)
129 return false; 130 return false;
130 131
131 return profile_->GetPrefs()->GetBoolean(prefs::kEnableStylusTools); 132 return profile_->GetPrefs()->GetBoolean(prefs::kEnableStylusTools);
132 } 133 }
133 134
134 void PaletteDelegateChromeOS::TakeScreenshot() { 135 void PaletteDelegateChromeOS::TakeScreenshot() {
135 auto* screenshot_delegate = ash::Shell::GetInstance() 136 auto* screenshot_delegate = ash::WmShellAura::Get()
136 ->accelerator_controller_delegate() 137 ->accelerator_controller_delegate()
137 ->screenshot_delegate(); 138 ->screenshot_delegate();
138 screenshot_delegate->HandleTakeScreenshotForAllRootWindows(); 139 screenshot_delegate->HandleTakeScreenshotForAllRootWindows();
139 } 140 }
140 141
141 void PaletteDelegateChromeOS::TakePartialScreenshot(const base::Closure& done) { 142 void PaletteDelegateChromeOS::TakePartialScreenshot(const base::Closure& done) {
142 auto* screenshot_controller = 143 auto* screenshot_controller =
143 ash::Shell::GetInstance()->screenshot_controller(); 144 ash::Shell::GetInstance()->screenshot_controller();
144 auto* screenshot_delegate = ash::Shell::GetInstance() 145 auto* screenshot_delegate = ash::WmShellAura::Get()
145 ->accelerator_controller_delegate() 146 ->accelerator_controller_delegate()
146 ->screenshot_delegate(); 147 ->screenshot_delegate();
147 148
148 screenshot_controller->set_pen_events_only(true); 149 screenshot_controller->set_pen_events_only(true);
149 screenshot_controller->StartPartialScreenshotSession( 150 screenshot_controller->StartPartialScreenshotSession(
150 screenshot_delegate, false /* draw_overlay_immediately */); 151 screenshot_delegate, false /* draw_overlay_immediately */);
151 screenshot_controller->set_on_screenshot_session_done( 152 screenshot_controller->set_on_screenshot_session_done(
152 base::Bind(&PaletteDelegateChromeOS::OnPartialScreenshotDone, 153 base::Bind(&PaletteDelegateChromeOS::OnPartialScreenshotDone,
153 weak_factory_.GetWeakPtr(), done)); 154 weak_factory_.GetWeakPtr(), done));
154 } 155 }
155 156
156 void PaletteDelegateChromeOS::CancelPartialScreenshot() { 157 void PaletteDelegateChromeOS::CancelPartialScreenshot() {
157 ash::Shell::GetInstance()->screenshot_controller()->CancelScreenshotSession(); 158 ash::Shell::GetInstance()->screenshot_controller()->CancelScreenshotSession();
158 } 159 }
159 160
160 } // namespace chromeos 161 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/ash_util.cc ('k') | chrome/browser/ui/browser_commands_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698