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/magnifier/partial_magnification_controller.h" | 5 #include "ash/magnifier/partial_magnification_controller.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
10 #include "ui/aura/window_event_dispatcher.h" | 10 #include "ui/aura/window_event_dispatcher.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 return; | 137 return; |
138 | 138 |
139 root_window->AddObserver(this); | 139 root_window->AddObserver(this); |
140 | 140 |
141 gfx::Point mouse( | 141 gfx::Point mouse( |
142 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot()); | 142 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot()); |
143 | 143 |
144 zoom_widget_ = new views::Widget; | 144 zoom_widget_ = new views::Widget; |
145 views::Widget::InitParams params( | 145 views::Widget::InitParams params( |
146 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 146 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
147 params.can_activate = false; | 147 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; |
148 params.accept_events = false; | 148 params.accept_events = false; |
149 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 149 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
150 params.parent = root_window; | 150 params.parent = root_window; |
151 zoom_widget_->Init(params); | 151 zoom_widget_->Init(params); |
152 zoom_widget_->SetBounds(gfx::Rect(mouse.x() - kMagnifierWidth / 2, | 152 zoom_widget_->SetBounds(gfx::Rect(mouse.x() - kMagnifierWidth / 2, |
153 mouse.y() - kMagnifierHeight / 2, | 153 mouse.y() - kMagnifierHeight / 2, |
154 kMagnifierWidth, kMagnifierHeight)); | 154 kMagnifierWidth, kMagnifierHeight)); |
155 zoom_widget_->set_focus_on_creation(false); | 155 zoom_widget_->set_focus_on_creation(false); |
156 zoom_widget_->Show(); | 156 zoom_widget_->Show(); |
157 | 157 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 iter != root_windows.end(); ++iter) { | 204 iter != root_windows.end(); ++iter) { |
205 aura::Window* root_window = *iter; | 205 aura::Window* root_window = *iter; |
206 if (root_window->ContainsPointInRoot( | 206 if (root_window->ContainsPointInRoot( |
207 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot())) | 207 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot())) |
208 return root_window; | 208 return root_window; |
209 } | 209 } |
210 return NULL; | 210 return NULL; |
211 } | 211 } |
212 | 212 |
213 } // namespace ash | 213 } // namespace ash |
OLD | NEW |