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

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

Issue 2808723004: Renames WmShell to ShellPort (Closed)
Patch Set: feedback Created 3 years, 8 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 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/aura/shell_port_classic.h"
9 #include "ash/screenshot_delegate.h" 9 #include "ash/screenshot_delegate.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
11 #include "ash/system/palette/palette_utils.h" 11 #include "ash/system/palette/palette_utils.h"
12 #include "ash/utility/screenshot_controller.h" 12 #include "ash/utility/screenshot_controller.h"
13 #include "base/memory/ptr_util.h" 13 #include "base/memory/ptr_util.h"
14 #include "chrome/browser/chrome_notification_types.h" 14 #include "chrome/browser/chrome_notification_types.h"
15 #include "chrome/browser/chromeos/note_taking_helper.h" 15 #include "chrome/browser/chromeos/note_taking_helper.h"
16 #include "chrome/browser/chromeos/profiles/profile_helper.h" 16 #include "chrome/browser/chromeos/profiles/profile_helper.h"
17 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
18 #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
126 } 126 }
127 127
128 bool PaletteDelegateChromeOS::ShouldShowPalette() { 128 bool PaletteDelegateChromeOS::ShouldShowPalette() {
129 if (!profile_) 129 if (!profile_)
130 return false; 130 return false;
131 131
132 return profile_->GetPrefs()->GetBoolean(prefs::kEnableStylusTools); 132 return profile_->GetPrefs()->GetBoolean(prefs::kEnableStylusTools);
133 } 133 }
134 134
135 void PaletteDelegateChromeOS::TakeScreenshot() { 135 void PaletteDelegateChromeOS::TakeScreenshot() {
136 auto* screenshot_delegate = ash::WmShellAura::Get() 136 auto* screenshot_delegate = ash::ShellPortClassic::Get()
137 ->accelerator_controller_delegate() 137 ->accelerator_controller_delegate()
138 ->screenshot_delegate(); 138 ->screenshot_delegate();
139 screenshot_delegate->HandleTakeScreenshotForAllRootWindows(); 139 screenshot_delegate->HandleTakeScreenshotForAllRootWindows();
140 } 140 }
141 141
142 void PaletteDelegateChromeOS::TakePartialScreenshot(const base::Closure& done) { 142 void PaletteDelegateChromeOS::TakePartialScreenshot(const base::Closure& done) {
143 auto* screenshot_controller = ash::Shell::Get()->screenshot_controller(); 143 auto* screenshot_controller = ash::Shell::Get()->screenshot_controller();
144 auto* screenshot_delegate = ash::WmShellAura::Get() 144 auto* screenshot_delegate = ash::ShellPortClassic::Get()
145 ->accelerator_controller_delegate() 145 ->accelerator_controller_delegate()
146 ->screenshot_delegate(); 146 ->screenshot_delegate();
147 147
148 screenshot_controller->set_pen_events_only(true); 148 screenshot_controller->set_pen_events_only(true);
149 screenshot_controller->StartPartialScreenshotSession( 149 screenshot_controller->StartPartialScreenshotSession(
150 screenshot_delegate, false /* draw_overlay_immediately */); 150 screenshot_delegate, false /* draw_overlay_immediately */);
151 screenshot_controller->set_on_screenshot_session_done( 151 screenshot_controller->set_on_screenshot_session_done(
152 base::Bind(&PaletteDelegateChromeOS::OnPartialScreenshotDone, 152 base::Bind(&PaletteDelegateChromeOS::OnPartialScreenshotDone,
153 weak_factory_.GetWeakPtr(), done)); 153 weak_factory_.GetWeakPtr(), done));
154 } 154 }
155 155
156 void PaletteDelegateChromeOS::CancelPartialScreenshot() { 156 void PaletteDelegateChromeOS::CancelPartialScreenshot() {
157 ash::Shell::Get()->screenshot_controller()->CancelScreenshotSession(); 157 ash::Shell::Get()->screenshot_controller()->CancelScreenshotSession();
158 } 158 }
159 159
160 } // namespace chromeos 160 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698