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

Side by Side Diff: ash/common/accelerators/accelerator_controller.cc

Issue 2775973002: Promotes more accessors from WmShell to Shell (Closed)
Patch Set: feedback 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 | « ash/ash_touch_exploration_manager_chromeos.cc ('k') | ash/common/keyboard/keyboard_ui.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 (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 "ash/common/accelerators/accelerator_controller.h" 5 #include "ash/common/accelerators/accelerator_controller.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/accelerators/accelerator_commands.h" 9 #include "ash/common/accelerators/accelerator_commands.h"
10 #include "ash/common/accelerators/accelerator_controller_delegate.h" 10 #include "ash/common/accelerators/accelerator_controller_delegate.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 auto* histogram = base::LinearHistogram::FactoryGet( 168 auto* histogram = base::LinearHistogram::FactoryGet(
169 histogram_name, 1, DEPRECATED_USAGE_COUNT, DEPRECATED_USAGE_COUNT + 1, 169 histogram_name, 1, DEPRECATED_USAGE_COUNT, DEPRECATED_USAGE_COUNT + 1,
170 base::HistogramBase::kUmaTargetedHistogramFlag); 170 base::HistogramBase::kUmaTargetedHistogramFlag);
171 histogram->Add(sample); 171 histogram->Add(sample);
172 } 172 }
173 173
174 void HandleCycleBackwardMRU(const ui::Accelerator& accelerator) { 174 void HandleCycleBackwardMRU(const ui::Accelerator& accelerator) {
175 if (accelerator.key_code() == ui::VKEY_TAB) 175 if (accelerator.key_code() == ui::VKEY_TAB)
176 base::RecordAction(base::UserMetricsAction("Accel_PrevWindow_Tab")); 176 base::RecordAction(base::UserMetricsAction("Accel_PrevWindow_Tab"));
177 177
178 WmShell::Get()->window_cycle_controller()->HandleCycleWindow( 178 Shell::Get()->window_cycle_controller()->HandleCycleWindow(
179 WindowCycleController::BACKWARD); 179 WindowCycleController::BACKWARD);
180 } 180 }
181 181
182 void HandleCycleForwardMRU(const ui::Accelerator& accelerator) { 182 void HandleCycleForwardMRU(const ui::Accelerator& accelerator) {
183 if (accelerator.key_code() == ui::VKEY_TAB) 183 if (accelerator.key_code() == ui::VKEY_TAB)
184 base::RecordAction(base::UserMetricsAction("Accel_NextWindow_Tab")); 184 base::RecordAction(base::UserMetricsAction("Accel_NextWindow_Tab"));
185 185
186 WmShell::Get()->window_cycle_controller()->HandleCycleWindow( 186 Shell::Get()->window_cycle_controller()->HandleCycleWindow(
187 WindowCycleController::FORWARD); 187 WindowCycleController::FORWARD);
188 } 188 }
189 189
190 void HandleRotatePaneFocus(FocusCycler::Direction direction) { 190 void HandleRotatePaneFocus(FocusCycler::Direction direction) {
191 switch (direction) { 191 switch (direction) {
192 // TODO(stevet): Not sure if this is the same as IDC_FOCUS_NEXT_PANE. 192 // TODO(stevet): Not sure if this is the same as IDC_FOCUS_NEXT_PANE.
193 case FocusCycler::FORWARD: { 193 case FocusCycler::FORWARD: {
194 base::RecordAction(UserMetricsAction("Accel_Focus_Next_Pane")); 194 base::RecordAction(UserMetricsAction("Accel_Focus_Next_Pane"));
195 break; 195 break;
196 } 196 }
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 } 394 }
395 395
396 void HandleToggleFullscreen(const ui::Accelerator& accelerator) { 396 void HandleToggleFullscreen(const ui::Accelerator& accelerator) {
397 if (accelerator.key_code() == ui::VKEY_MEDIA_LAUNCH_APP2) 397 if (accelerator.key_code() == ui::VKEY_MEDIA_LAUNCH_APP2)
398 base::RecordAction(UserMetricsAction("Accel_Fullscreen_F4")); 398 base::RecordAction(UserMetricsAction("Accel_Fullscreen_F4"));
399 accelerators::ToggleFullscreen(); 399 accelerators::ToggleFullscreen();
400 } 400 }
401 401
402 void HandleToggleOverview() { 402 void HandleToggleOverview() {
403 base::RecordAction(base::UserMetricsAction("Accel_Overview_F5")); 403 base::RecordAction(base::UserMetricsAction("Accel_Overview_F5"));
404 WmShell::Get()->window_selector_controller()->ToggleOverview(); 404 Shell::Get()->window_selector_controller()->ToggleOverview();
405 } 405 }
406 406
407 bool CanHandleWindowSnap() { 407 bool CanHandleWindowSnap() {
408 WmWindow* active_window = WmShell::Get()->GetActiveWindow(); 408 WmWindow* active_window = WmShell::Get()->GetActiveWindow();
409 if (!active_window) 409 if (!active_window)
410 return false; 410 return false;
411 wm::WindowState* window_state = active_window->GetWindowState(); 411 wm::WindowState* window_state = active_window->GetWindowState();
412 // Disable window snapping shortcut key for full screen window due to 412 // Disable window snapping shortcut key for full screen window due to
413 // http://crbug.com/135487. 413 // http://crbug.com/135487.
414 return (window_state && window_state->IsUserPositionable() && 414 return (window_state && window_state->IsUserPositionable() &&
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
1174 case TOGGLE_MAXIMIZED: 1174 case TOGGLE_MAXIMIZED:
1175 accelerators::ToggleMaximized(); 1175 accelerators::ToggleMaximized();
1176 break; 1176 break;
1177 case TOGGLE_OVERVIEW: 1177 case TOGGLE_OVERVIEW:
1178 HandleToggleOverview(); 1178 HandleToggleOverview();
1179 break; 1179 break;
1180 case TOGGLE_SPOKEN_FEEDBACK: 1180 case TOGGLE_SPOKEN_FEEDBACK:
1181 HandleToggleSpokenFeedback(); 1181 HandleToggleSpokenFeedback();
1182 break; 1182 break;
1183 case TOGGLE_WIFI: 1183 case TOGGLE_WIFI:
1184 WmShell::Get()->system_tray_notifier()->NotifyRequestToggleWifi(); 1184 Shell::Get()->system_tray_notifier()->NotifyRequestToggleWifi();
1185 break; 1185 break;
1186 case VOLUME_DOWN: 1186 case VOLUME_DOWN:
1187 HandleVolumeDown(volume_controller_.get(), accelerator); 1187 HandleVolumeDown(volume_controller_.get(), accelerator);
1188 break; 1188 break;
1189 case VOLUME_MUTE: 1189 case VOLUME_MUTE:
1190 HandleVolumeMute(volume_controller_.get(), accelerator); 1190 HandleVolumeMute(volume_controller_.get(), accelerator);
1191 break; 1191 break;
1192 case VOLUME_UP: 1192 case VOLUME_UP:
1193 HandleVolumeUp(volume_controller_.get(), accelerator); 1193 HandleVolumeUp(volume_controller_.get(), accelerator);
1194 break; 1194 break;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
1290 data->uma_histogram_name, data->notification_message_id, 1290 data->uma_histogram_name, data->notification_message_id,
1291 data->old_shortcut_id, data->new_shortcut_id); 1291 data->old_shortcut_id, data->new_shortcut_id);
1292 1292
1293 if (!data->deprecated_enabled) 1293 if (!data->deprecated_enabled)
1294 return AcceleratorProcessingStatus::STOP; 1294 return AcceleratorProcessingStatus::STOP;
1295 1295
1296 return AcceleratorProcessingStatus::PROCEED; 1296 return AcceleratorProcessingStatus::PROCEED;
1297 } 1297 }
1298 1298
1299 } // namespace ash 1299 } // namespace ash
OLDNEW
« no previous file with comments | « ash/ash_touch_exploration_manager_chromeos.cc ('k') | ash/common/keyboard/keyboard_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698