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

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

Issue 259253002: 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
95 void TouchObserverHUD::OnDisplayAdded(const gfx::Display& new_display) {} 89 void TouchObserverHUD::OnDisplayAdded(const gfx::Display& new_display) {}
96 90
97 void TouchObserverHUD::OnDisplayRemoved(const gfx::Display& old_display) { 91 void TouchObserverHUD::OnDisplayRemoved(const gfx::Display& old_display) {
98 if (old_display.id() != display_id_) 92 if (old_display.id() != display_id_)
99 return; 93 return;
100 widget_->CloseNow(); 94 widget_->CloseNow();
101 } 95 }
102 96
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
103 #if defined(OS_CHROMEOS) 105 #if defined(OS_CHROMEOS)
104 void TouchObserverHUD::OnDisplayModeChanged( 106 void TouchObserverHUD::OnDisplayModeChanged(
105 const ui::DisplayConfigurator::DisplayStateList& outputs) { 107 const ui::DisplayConfigurator::DisplayStateList& outputs) {
106 // Clear touch HUD for any change in display mode (single, dual extended, dual 108 // Clear touch HUD for any change in display mode (single, dual extended, dual
107 // mirrored, ...). 109 // mirrored, ...).
108 Clear(); 110 Clear();
109 } 111 }
110 #endif // defined(OS_CHROMEOS) 112 #endif // defined(OS_CHROMEOS)
111 113
112 void TouchObserverHUD::OnDisplaysInitialized() { 114 void TouchObserverHUD::OnDisplaysInitialized() {
(...skipping 28 matching lines...) Expand all
141 widget_->GetNativeView(), 143 widget_->GetNativeView(),
142 Shell::GetContainer(root_window_, kShellWindowId_OverlayContainer)); 144 Shell::GetContainer(root_window_, kShellWindowId_OverlayContainer));
143 145
144 RootWindowController* controller = GetRootWindowController(root_window_); 146 RootWindowController* controller = GetRootWindowController(root_window_);
145 SetHudForRootWindowController(controller); 147 SetHudForRootWindowController(controller);
146 148
147 root_window_->AddPreTargetHandler(this); 149 root_window_->AddPreTargetHandler(this);
148 } 150 }
149 151
150 } // namespace ash 152 } // 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