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

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

Issue 184903003: Window ownership -> WindowTreeHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 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 | 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 <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <iostream> 9 #include <iostream>
10 #include <string> 10 #include <string>
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 553
554 bool HandleToggleFullscreen(ui::KeyboardCode key_code) { 554 bool HandleToggleFullscreen(ui::KeyboardCode key_code) {
555 if (key_code == ui::VKEY_MEDIA_LAUNCH_APP2) { 555 if (key_code == ui::VKEY_MEDIA_LAUNCH_APP2) {
556 base::RecordAction(UserMetricsAction("Accel_Fullscreen_F4")); 556 base::RecordAction(UserMetricsAction("Accel_Fullscreen_F4"));
557 } 557 }
558 accelerators::ToggleFullscreen(); 558 accelerators::ToggleFullscreen();
559 return true; 559 return true;
560 } 560 }
561 561
562 bool HandleToggleRootWindowFullScreen() { 562 bool HandleToggleRootWindowFullScreen() {
563 Shell::GetPrimaryRootWindow()->GetDispatcher()->host()->ToggleFullScreen(); 563 Shell::GetPrimaryRootWindow()->GetHost()->ToggleFullScreen();
564 return true; 564 return true;
565 } 565 }
566 566
567 bool HandleWindowSnap(int action) { 567 bool HandleWindowSnap(int action) {
568 wm::WindowState* window_state = wm::GetActiveWindowState(); 568 wm::WindowState* window_state = wm::GetActiveWindowState();
569 // Disable window snapping shortcut key for full screen window due to 569 // Disable window snapping shortcut key for full screen window due to
570 // http://crbug.com/135487. 570 // http://crbug.com/135487.
571 if (!window_state || 571 if (!window_state ||
572 window_state->window()->type() != ui::wm::WINDOW_TYPE_NORMAL || 572 window_state->window()->type() != ui::wm::WINDOW_TYPE_NORMAL ||
573 window_state->IsFullscreen()) { 573 window_state->IsFullscreen()) {
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 696
697 #endif // defined(OS_CHROMEOS) 697 #endif // defined(OS_CHROMEOS)
698 698
699 // Debug print methods. 699 // Debug print methods.
700 700
701 bool HandlePrintLayerHierarchy() { 701 bool HandlePrintLayerHierarchy() {
702 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); 702 aura::Window::Windows root_windows = Shell::GetAllRootWindows();
703 for (size_t i = 0; i < root_windows.size(); ++i) { 703 for (size_t i = 0; i < root_windows.size(); ++i) {
704 ui::PrintLayerHierarchy( 704 ui::PrintLayerHierarchy(
705 root_windows[i]->layer(), 705 root_windows[i]->layer(),
706 root_windows[i]->GetDispatcher()->GetLastMouseLocationInRoot()); 706 root_windows[i]->GetHost()->dispatcher()->GetLastMouseLocationInRoot());
707 } 707 }
708 return true; 708 return true;
709 } 709 }
710 710
711 bool HandlePrintViewHierarchy() { 711 bool HandlePrintViewHierarchy() {
712 aura::Window* active_window = ash::wm::GetActiveWindow(); 712 aura::Window* active_window = ash::wm::GetActiveWindow();
713 if (!active_window) 713 if (!active_window)
714 return true; 714 return true;
715 views::Widget* browser_widget = 715 views::Widget* browser_widget =
716 views::Widget::GetWidgetForNativeWindow(active_window); 716 views::Widget::GetWidgetForNativeWindow(active_window);
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1208 keyboard_brightness_control_delegate) { 1208 keyboard_brightness_control_delegate) {
1209 keyboard_brightness_control_delegate_ = 1209 keyboard_brightness_control_delegate_ =
1210 keyboard_brightness_control_delegate.Pass(); 1210 keyboard_brightness_control_delegate.Pass();
1211 } 1211 }
1212 1212
1213 bool AcceleratorController::CanHandleAccelerators() const { 1213 bool AcceleratorController::CanHandleAccelerators() const {
1214 return true; 1214 return true;
1215 } 1215 }
1216 1216
1217 } // namespace ash 1217 } // 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