OLD | NEW |
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 Loading... |
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( |
| 98 const gfx::Display& display, |
| 99 DisplayObserver::DisplayMetrics metrics) { |
| 100 if (display.id() != display_id_ || !(metrics & DISPLAY_METRIC_BOUNDS)) |
| 101 return; |
| 102 |
| 103 widget_->SetSize(display.size()); |
| 104 } |
| 105 |
103 #if defined(OS_CHROMEOS) | 106 #if defined(OS_CHROMEOS) |
104 void TouchObserverHUD::OnDisplayModeChanged( | 107 void TouchObserverHUD::OnDisplayModeChanged( |
105 const ui::DisplayConfigurator::DisplayStateList& outputs) { | 108 const ui::DisplayConfigurator::DisplayStateList& outputs) { |
106 // Clear touch HUD for any change in display mode (single, dual extended, dual | 109 // Clear touch HUD for any change in display mode (single, dual extended, dual |
107 // mirrored, ...). | 110 // mirrored, ...). |
108 Clear(); | 111 Clear(); |
109 } | 112 } |
110 #endif // defined(OS_CHROMEOS) | 113 #endif // defined(OS_CHROMEOS) |
111 | 114 |
112 void TouchObserverHUD::OnDisplaysInitialized() { | 115 void TouchObserverHUD::OnDisplaysInitialized() { |
(...skipping 28 matching lines...) Expand all Loading... |
141 widget_->GetNativeView(), | 144 widget_->GetNativeView(), |
142 Shell::GetContainer(root_window_, kShellWindowId_OverlayContainer)); | 145 Shell::GetContainer(root_window_, kShellWindowId_OverlayContainer)); |
143 | 146 |
144 RootWindowController* controller = GetRootWindowController(root_window_); | 147 RootWindowController* controller = GetRootWindowController(root_window_); |
145 SetHudForRootWindowController(controller); | 148 SetHudForRootWindowController(controller); |
146 | 149 |
147 root_window_->AddPreTargetHandler(this); | 150 root_window_->AddPreTargetHandler(this); |
148 } | 151 } |
149 | 152 |
150 } // namespace ash | 153 } // namespace ash |
OLD | NEW |