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

Side by Side Diff: ash/touch/touch_observer_hud.cc

Issue 294963004: Revert of Add OnDisplayMetricsChanged in DisplayObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update_orientation
Patch Set: Created 6 years, 7 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/touch/touch_observer_hud.h ('k') | ash/wm/maximize_mode/maximize_mode_window_manager.h » ('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/touch/touch_observer_hud.h" 5 #include "ash/touch/touch_observer_hud.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/root_window_settings.h" 8 #include "ash/root_window_settings.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 } 79 }
80 80
81 void TouchObserverHUD::OnTouchEvent(ui::TouchEvent* /*event*/) { 81 void TouchObserverHUD::OnTouchEvent(ui::TouchEvent* /*event*/) {
82 } 82 }
83 83
84 void TouchObserverHUD::OnWidgetDestroying(views::Widget* widget) { 84 void TouchObserverHUD::OnWidgetDestroying(views::Widget* widget) {
85 DCHECK_EQ(widget, widget_); 85 DCHECK_EQ(widget, widget_);
86 delete this; 86 delete this;
87 } 87 }
88 88
89 void TouchObserverHUD::OnDisplayBoundsChanged(const gfx::Display& display) {
90 if (display.id() != display_id_)
91 return;
92 widget_->SetSize(display.size());
93 }
94
89 void TouchObserverHUD::OnDisplayAdded(const gfx::Display& new_display) {} 95 void TouchObserverHUD::OnDisplayAdded(const gfx::Display& new_display) {}
90 96
91 void TouchObserverHUD::OnDisplayRemoved(const gfx::Display& old_display) { 97 void TouchObserverHUD::OnDisplayRemoved(const gfx::Display& old_display) {
92 if (old_display.id() != display_id_) 98 if (old_display.id() != display_id_)
93 return; 99 return;
94 widget_->CloseNow(); 100 widget_->CloseNow();
95 } 101 }
96 102
97 void TouchObserverHUD::OnDisplayMetricsChanged(const gfx::Display& display,
98 uint32_t metrics) {
99 if (display.id() != display_id_ || !(metrics & DISPLAY_METRIC_BOUNDS))
100 return;
101
102 widget_->SetSize(display.size());
103 }
104
105 #if defined(OS_CHROMEOS) 103 #if defined(OS_CHROMEOS)
106 void TouchObserverHUD::OnDisplayModeChanged( 104 void TouchObserverHUD::OnDisplayModeChanged(
107 const ui::DisplayConfigurator::DisplayStateList& outputs) { 105 const ui::DisplayConfigurator::DisplayStateList& outputs) {
108 // Clear touch HUD for any change in display mode (single, dual extended, dual 106 // Clear touch HUD for any change in display mode (single, dual extended, dual
109 // mirrored, ...). 107 // mirrored, ...).
110 Clear(); 108 Clear();
111 } 109 }
112 #endif // defined(OS_CHROMEOS) 110 #endif // defined(OS_CHROMEOS)
113 111
114 void TouchObserverHUD::OnDisplaysInitialized() { 112 void TouchObserverHUD::OnDisplaysInitialized() {
(...skipping 28 matching lines...) Expand all
143 widget_->GetNativeView(), 141 widget_->GetNativeView(),
144 Shell::GetContainer(root_window_, kShellWindowId_OverlayContainer)); 142 Shell::GetContainer(root_window_, kShellWindowId_OverlayContainer));
145 143
146 RootWindowController* controller = GetRootWindowController(root_window_); 144 RootWindowController* controller = GetRootWindowController(root_window_);
147 SetHudForRootWindowController(controller); 145 SetHudForRootWindowController(controller);
148 146
149 root_window_->AddPreTargetHandler(this); 147 root_window_->AddPreTargetHandler(this);
150 } 148 }
151 149
152 } // namespace ash 150 } // namespace ash
OLDNEW
« no previous file with comments | « ash/touch/touch_observer_hud.h ('k') | ash/wm/maximize_mode/maximize_mode_window_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698