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

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

Issue 222963003: ash: Small fixes for ash_unittests when building in aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ash/wm/lock_state_controller.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/accelerators/accelerator_controller.h" 5 #include "ash/accelerators/accelerator_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <iostream> 9 #include <iostream>
10 #include <string> 10 #include <string>
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 base::RecordAction(UserMetricsAction("Accel_Scale_Ui_Down")); 375 base::RecordAction(UserMetricsAction("Accel_Scale_Ui_Down"));
376 } 376 }
377 377
378 const DisplayInfo& display_info = display_manager->GetDisplayInfo(display_id); 378 const DisplayInfo& display_info = display_manager->GetDisplayInfo(display_id);
379 float next_scale = 379 float next_scale =
380 internal::DisplayManager::GetNextUIScale(display_info, up); 380 internal::DisplayManager::GetNextUIScale(display_info, up);
381 display_manager->SetDisplayUIScale(display_id, next_scale); 381 display_manager->SetDisplayUIScale(display_id, next_scale);
382 return true; 382 return true;
383 } 383 }
384 384
385 #if defined(OS_CHROMEOS)
385 bool HandleSwapPrimaryDisplay() { 386 bool HandleSwapPrimaryDisplay() {
386 base::RecordAction(UserMetricsAction("Accel_Swap_Primary_Display")); 387 base::RecordAction(UserMetricsAction("Accel_Swap_Primary_Display"));
387 Shell::GetInstance()->display_controller()->SwapPrimaryDisplay(); 388 Shell::GetInstance()->display_controller()->SwapPrimaryDisplay();
388 return true; 389 return true;
389 } 390 }
391 #endif
390 392
391 bool HandleShowKeyboardOverlay() { 393 bool HandleShowKeyboardOverlay() {
392 base::RecordAction(UserMetricsAction("Accel_Show_Keyboard_Overlay")); 394 base::RecordAction(UserMetricsAction("Accel_Show_Keyboard_Overlay"));
393 ash::Shell::GetInstance()->new_window_delegate()->ShowKeyboardOverlay(); 395 ash::Shell::GetInstance()->new_window_delegate()->ShowKeyboardOverlay();
394 396
395 return true; 397 return true;
396 } 398 }
397 399
398 void HandleShowMessageCenterBubble() { 400 void HandleShowMessageCenterBubble() {
399 base::RecordAction(UserMetricsAction("Accel_Show_Message_Center_Bubble")); 401 base::RecordAction(UserMetricsAction("Accel_Show_Message_Center_Bubble"));
(...skipping 19 matching lines...) Expand all
419 } 421 }
420 return false; 422 return false;
421 } 423 }
422 424
423 bool HandleShowTaskManager() { 425 bool HandleShowTaskManager() {
424 base::RecordAction(UserMetricsAction("Accel_Show_Task_Manager")); 426 base::RecordAction(UserMetricsAction("Accel_Show_Task_Manager"));
425 Shell::GetInstance()->new_window_delegate()->ShowTaskManager(); 427 Shell::GetInstance()->new_window_delegate()->ShowTaskManager();
426 return true; 428 return true;
427 } 429 }
428 430
431 #if defined(OS_CHROMEOS)
429 void HandleSilenceSpokenFeedback() { 432 void HandleSilenceSpokenFeedback() {
430 base::RecordAction(UserMetricsAction("Accel_Silence_Spoken_Feedback")); 433 base::RecordAction(UserMetricsAction("Accel_Silence_Spoken_Feedback"));
431 434
432 AccessibilityDelegate* delegate = 435 AccessibilityDelegate* delegate =
433 Shell::GetInstance()->accessibility_delegate(); 436 Shell::GetInstance()->accessibility_delegate();
434 if (!delegate->IsSpokenFeedbackEnabled()) 437 if (!delegate->IsSpokenFeedbackEnabled())
435 return; 438 return;
436 delegate->SilenceSpokenFeedback(); 439 delegate->SilenceSpokenFeedback();
437 } 440 }
441 #endif
438 442
439 bool HandleSwitchIme(ImeControlDelegate* ime_control_delegate, 443 bool HandleSwitchIme(ImeControlDelegate* ime_control_delegate,
440 const ui::Accelerator& accelerator) { 444 const ui::Accelerator& accelerator) {
441 base::RecordAction(UserMetricsAction("Accel_Switch_Ime")); 445 base::RecordAction(UserMetricsAction("Accel_Switch_Ime"));
442 if (ime_control_delegate) 446 if (ime_control_delegate)
443 return ime_control_delegate->HandleSwitchIme(accelerator); 447 return ime_control_delegate->HandleSwitchIme(accelerator);
444 return false; 448 return false;
445 } 449 }
446 450
447 bool HandleTakePartialScreenshot(ScreenshotDelegate* screenshot_delegate) { 451 bool HandleTakePartialScreenshot(ScreenshotDelegate* screenshot_delegate) {
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 keyboard_brightness_control_delegate) { 1187 keyboard_brightness_control_delegate) {
1184 keyboard_brightness_control_delegate_ = 1188 keyboard_brightness_control_delegate_ =
1185 keyboard_brightness_control_delegate.Pass(); 1189 keyboard_brightness_control_delegate.Pass();
1186 } 1190 }
1187 1191
1188 bool AcceleratorController::CanHandleAccelerators() const { 1192 bool AcceleratorController::CanHandleAccelerators() const {
1189 return true; 1193 return true;
1190 } 1194 }
1191 1195
1192 } // namespace ash 1196 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/wm/lock_state_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698