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

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

Issue 9414028: Aura: New window shadows, desktop background debug toggle (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix clang Created 8 years, 10 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/accelerators/accelerator_controller_unittest.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 "ash/brightness_control_delegate.h" 7 #include "ash/brightness_control_delegate.h"
8 #include "ash/caps_lock_delegate.h" 8 #include "ash/caps_lock_delegate.h"
9 #include "ash/ime_control_delegate.h" 9 #include "ash/ime_control_delegate.h"
10 #include "ash/launcher/launcher.h" 10 #include "ash/launcher/launcher.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 VOLUME_MUTE, 43 VOLUME_MUTE,
44 VOLUME_UP, 44 VOLUME_UP,
45 #if defined(OS_CHROMEOS) 45 #if defined(OS_CHROMEOS)
46 LOCK_SCREEN, 46 LOCK_SCREEN,
47 #endif 47 #endif
48 #if !defined(NDEBUG) 48 #if !defined(NDEBUG)
49 PRINT_LAYER_HIERARCHY, 49 PRINT_LAYER_HIERARCHY,
50 PRINT_WINDOW_HIERARCHY, 50 PRINT_WINDOW_HIERARCHY,
51 ROTATE_SCREEN, 51 ROTATE_SCREEN,
52 TOGGLE_COMPACT_WINDOW_MODE, 52 TOGGLE_COMPACT_WINDOW_MODE,
53 TOGGLE_DESKTOP_BACKGROUND_MODE,
53 TOGGLE_ROOT_WINDOW_FULL_SCREEN, 54 TOGGLE_ROOT_WINDOW_FULL_SCREEN,
54 #endif 55 #endif
55 }; 56 };
56 57
57 // Accelerators handled by AcceleratorController. 58 // Accelerators handled by AcceleratorController.
58 const struct AcceleratorData { 59 const struct AcceleratorData {
59 ui::EventType type; 60 ui::EventType type;
60 ui::KeyboardCode keycode; 61 ui::KeyboardCode keycode;
61 bool shift; 62 bool shift;
62 bool ctrl; 63 bool ctrl;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_VOLUME_DOWN, false, false, false, 118 { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_VOLUME_DOWN, false, false, false,
118 VOLUME_DOWN }, 119 VOLUME_DOWN },
119 { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_F10, false, false, false, VOLUME_UP }, 120 { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_F10, false, false, false, VOLUME_UP },
120 { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_VOLUME_UP, false, false, false, 121 { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_VOLUME_UP, false, false, false,
121 VOLUME_UP }, 122 VOLUME_UP },
122 #if !defined(NDEBUG) 123 #if !defined(NDEBUG)
123 { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_HOME, false, true, false, 124 { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_HOME, false, true, false,
124 ROTATE_SCREEN }, 125 ROTATE_SCREEN },
125 { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_A, false, true, true, 126 { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_A, false, true, true,
126 TOGGLE_COMPACT_WINDOW_MODE }, 127 TOGGLE_COMPACT_WINDOW_MODE },
128 { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_B, false, true, true,
129 TOGGLE_DESKTOP_BACKGROUND_MODE },
127 { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_F11, false, true, false, 130 { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_F11, false, true, false,
128 TOGGLE_ROOT_WINDOW_FULL_SCREEN }, 131 TOGGLE_ROOT_WINDOW_FULL_SCREEN },
129 { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_L, false, false, true, 132 { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_L, false, false, true,
130 PRINT_LAYER_HIERARCHY }, 133 PRINT_LAYER_HIERARCHY },
131 { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_L, true, false, true, 134 { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_L, true, false, true,
132 PRINT_WINDOW_HIERARCHY }, 135 PRINT_WINDOW_HIERARCHY },
133 // For testing on systems where Alt-Tab is already mapped. 136 // For testing on systems where Alt-Tab is already mapped.
134 { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_W, false, false, true, 137 { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_W, false, false, true,
135 CYCLE_FORWARD }, 138 CYCLE_FORWARD },
136 { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_W, true, false, true, 139 { ui::ET_TRANSLATED_KEY_PRESS, ui::VKEY_W, true, false, true,
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 } 200 }
198 201
199 bool HandleToggleCompactWindowMode() { 202 bool HandleToggleCompactWindowMode() {
200 if (ash::Shell::GetInstance()->IsWindowModeCompact()) 203 if (ash::Shell::GetInstance()->IsWindowModeCompact())
201 ash::Shell::GetInstance()->ChangeWindowMode(ash::Shell::MODE_OVERLAPPING); 204 ash::Shell::GetInstance()->ChangeWindowMode(ash::Shell::MODE_OVERLAPPING);
202 else 205 else
203 ash::Shell::GetInstance()->ChangeWindowMode(ash::Shell::MODE_COMPACT); 206 ash::Shell::GetInstance()->ChangeWindowMode(ash::Shell::MODE_COMPACT);
204 return true; 207 return true;
205 } 208 }
206 209
210 bool HandleToggleDesktopBackgroundMode() {
211 ash::Shell* shell = ash::Shell::GetInstance();
212 if (shell->desktop_background_mode() == ash::Shell::BACKGROUND_IMAGE)
213 shell->SetDesktopBackgroundMode(ash::Shell::BACKGROUND_SOLID_COLOR);
214 else
215 shell->SetDesktopBackgroundMode(ash::Shell::BACKGROUND_IMAGE);
216 return true;
217 }
218
207 bool HandleToggleRootWindowFullScreen() { 219 bool HandleToggleRootWindowFullScreen() {
208 aura::RootWindow::GetInstance()->ToggleFullScreen(); 220 aura::RootWindow::GetInstance()->ToggleFullScreen();
209 return true; 221 return true;
210 } 222 }
211 223
212 bool HandlePrintLayerHierarchy() { 224 bool HandlePrintLayerHierarchy() {
213 aura::RootWindow* root_window = aura::RootWindow::GetInstance(); 225 aura::RootWindow* root_window = aura::RootWindow::GetInstance();
214 ui::PrintLayerHierarchy(root_window->layer(), 226 ui::PrintLayerHierarchy(root_window->layer(),
215 root_window->last_mouse_location()); 227 root_window->last_mouse_location());
216 return true; 228 return true;
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 break; 386 break;
375 case SWITCH_IME: 387 case SWITCH_IME:
376 if (ime_control_delegate_.get()) 388 if (ime_control_delegate_.get())
377 return ime_control_delegate_->HandleSwitchIme(accelerator); 389 return ime_control_delegate_->HandleSwitchIme(accelerator);
378 break; 390 break;
379 #if !defined(NDEBUG) 391 #if !defined(NDEBUG)
380 case ROTATE_SCREEN: 392 case ROTATE_SCREEN:
381 return HandleRotateScreen(); 393 return HandleRotateScreen();
382 case TOGGLE_COMPACT_WINDOW_MODE: 394 case TOGGLE_COMPACT_WINDOW_MODE:
383 return HandleToggleCompactWindowMode(); 395 return HandleToggleCompactWindowMode();
396 case TOGGLE_DESKTOP_BACKGROUND_MODE:
397 return HandleToggleDesktopBackgroundMode();
384 case TOGGLE_ROOT_WINDOW_FULL_SCREEN: 398 case TOGGLE_ROOT_WINDOW_FULL_SCREEN:
385 return HandleToggleRootWindowFullScreen(); 399 return HandleToggleRootWindowFullScreen();
386 case PRINT_LAYER_HIERARCHY: 400 case PRINT_LAYER_HIERARCHY:
387 return HandlePrintLayerHierarchy(); 401 return HandlePrintLayerHierarchy();
388 case PRINT_WINDOW_HIERARCHY: 402 case PRINT_WINDOW_HIERARCHY:
389 return HandlePrintWindowHierarchy(); 403 return HandlePrintWindowHierarchy();
390 #endif 404 #endif
391 default: 405 default:
392 NOTREACHED() << "Unhandled action " << it->second;; 406 NOTREACHED() << "Unhandled action " << it->second;;
393 } 407 }
394 return false; 408 return false;
395 } 409 }
396 410
397 bool AcceleratorController::CanHandleAccelerators() const { 411 bool AcceleratorController::CanHandleAccelerators() const {
398 return true; 412 return true;
399 } 413 }
400 414
401 } // namespace ash 415 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/accelerators/accelerator_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698