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

Side by Side Diff: ash/accelerators/accelerator_controller_delegate_aura.cc

Issue 2285633002: Add WM_EVENT_TRUSTED_PIN and WINDOW_STATE_TYPE_TRUSTED_PINNED to Ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 3 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 | « ash/accelerators/accelerator_commands_unittest.cc ('k') | ash/common/wm/default_state.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 "ash/accelerators/accelerator_controller_delegate_aura.h" 5 #include "ash/accelerators/accelerator_controller_delegate_aura.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 } 216 }
217 217
218 void HandleTakeScreenshot(ScreenshotDelegate* screenshot_delegate) { 218 void HandleTakeScreenshot(ScreenshotDelegate* screenshot_delegate) {
219 base::RecordAction(UserMetricsAction("Accel_Take_Screenshot")); 219 base::RecordAction(UserMetricsAction("Accel_Take_Screenshot"));
220 DCHECK(screenshot_delegate); 220 DCHECK(screenshot_delegate);
221 if (screenshot_delegate->CanTakeScreenshot()) 221 if (screenshot_delegate->CanTakeScreenshot())
222 screenshot_delegate->HandleTakeScreenshotForAllRootWindows(); 222 screenshot_delegate->HandleTakeScreenshotForAllRootWindows();
223 } 223 }
224 224
225 bool CanHandleUnpin() { 225 bool CanHandleUnpin() {
226 // Returns true only for WINDOW_STATE_TYPE_PINNED.
227 // WINDOW_STATE_TYPE_TRUSTED_PINNED does not accept user's unpin operation.
226 wm::WindowState* window_state = wm::GetActiveWindowState(); 228 wm::WindowState* window_state = wm::GetActiveWindowState();
227 return window_state && window_state->IsPinned(); 229 return window_state &&
230 window_state->GetStateType() == wm::WINDOW_STATE_TYPE_PINNED;
228 } 231 }
229 232
230 #if defined(OS_CHROMEOS) 233 #if defined(OS_CHROMEOS)
231 void HandleSwapPrimaryDisplay() { 234 void HandleSwapPrimaryDisplay() {
232 base::RecordAction(UserMetricsAction("Accel_Swap_Primary_Display")); 235 base::RecordAction(UserMetricsAction("Accel_Swap_Primary_Display"));
233 Shell::GetInstance()->display_configuration_controller()->SetPrimaryDisplayId( 236 Shell::GetInstance()->display_configuration_controller()->SetPrimaryDisplayId(
234 ScreenUtil::GetSecondaryDisplay().id(), true /* user_action */); 237 ScreenUtil::GetSecondaryDisplay().id(), true /* user_action */);
235 } 238 }
236 239
237 void HandleToggleMirrorMode() { 240 void HandleToggleMirrorMode() {
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 message_center::NotifierId( 499 message_center::NotifierId(
497 message_center::NotifierId::SYSTEM_COMPONENT, 500 message_center::NotifierId::SYSTEM_COMPONENT,
498 system_notifier::kNotifierDeprecatedAccelerator), 501 system_notifier::kNotifierDeprecatedAccelerator),
499 message_center::RichNotificationData(), 502 message_center::RichNotificationData(),
500 new DeprecatedAcceleratorNotificationDelegate)); 503 new DeprecatedAcceleratorNotificationDelegate));
501 message_center::MessageCenter::Get()->AddNotification( 504 message_center::MessageCenter::Get()->AddNotification(
502 std::move(notification)); 505 std::move(notification));
503 } 506 }
504 507
505 } // namespace ash 508 } // namespace ash
OLDNEW
« no previous file with comments | « ash/accelerators/accelerator_commands_unittest.cc ('k') | ash/common/wm/default_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698