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

Side by Side Diff: ash/magnifier/partial_magnification_controller.cc

Issue 286733002: [Refactor] Consolidate the logic for whether a widget can be activated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 | Annotate | Revision Log
« no previous file with comments | « ash/display/shared_display_edge_indicator.cc ('k') | ash/shelf/shelf_widget.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/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
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
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
OLDNEW
« no previous file with comments | « ash/display/shared_display_edge_indicator.cc ('k') | ash/shelf/shelf_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698