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

Side by Side Diff: ash/wm/overview/window_overview.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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/wm/overview/window_overview.h" 5 #include "ash/wm/overview/window_overview.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/accessibility_delegate.h" 9 #include "ash/accessibility_delegate.h"
10 #include "ash/metrics/user_metrics_recorder.h" 10 #include "ash/metrics/user_metrics_recorder.h"
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 300
301 // TODO(flackr): StopPropogation prevents generation of gesture events. 301 // TODO(flackr): StopPropogation prevents generation of gesture events.
302 // We should find a better way to prevent events from being delivered to 302 // We should find a better way to prevent events from being delivered to
303 // the window, perhaps a transparent window in front of the target window 303 // the window, perhaps a transparent window in front of the target window
304 // or using EventClientImpl::CanProcessEventsWithinSubtree and then a tap 304 // or using EventClientImpl::CanProcessEventsWithinSubtree and then a tap
305 // gesture could be used to activate the window. 305 // gesture could be used to activate the window.
306 event->SetHandled(); 306 event->SetHandled();
307 window_selector_->SelectWindow(target); 307 window_selector_->SelectWindow(target);
308 } 308 }
309 309
310 void WindowOverview::OnDisplayBoundsChanged(const gfx::Display& display) {
311 PositionWindows(/* animate */ false);
312 }
313
314 void WindowOverview::OnDisplayAdded(const gfx::Display& display) { 310 void WindowOverview::OnDisplayAdded(const gfx::Display& display) {
315 } 311 }
316 312
317 void WindowOverview::OnDisplayRemoved(const gfx::Display& display) { 313 void WindowOverview::OnDisplayRemoved(const gfx::Display& display) {
318 } 314 }
319 315
316 void WindowOverview::OnDisplayMetricsChanged(
317 const gfx::Display& display, gfx::DisplayObserver::DisplayMetrics metrics) {
318 PositionWindows(/* animate */ false);
319 }
320
320 aura::Window* WindowOverview::GetEventTarget(ui::LocatedEvent* event) { 321 aura::Window* WindowOverview::GetEventTarget(ui::LocatedEvent* event) {
321 aura::Window* target = static_cast<aura::Window*>(event->target()); 322 aura::Window* target = static_cast<aura::Window*>(event->target());
322 // If the target window doesn't actually contain the event location (i.e. 323 // If the target window doesn't actually contain the event location (i.e.
323 // mouse down over the window and mouse up elsewhere) then do not select the 324 // mouse down over the window and mouse up elsewhere) then do not select the
324 // window. 325 // window.
325 if (!target->ContainsPoint(event->location())) 326 if (!target->ContainsPoint(event->location()))
326 return NULL; 327 return NULL;
327 328
328 return GetTargetedWindow(target); 329 return GetTargetedWindow(target);
329 } 330 }
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 } 475 }
475 476
476 gfx::Rect WindowOverview::GetSelectionBounds(size_t index) { 477 gfx::Rect WindowOverview::GetSelectionBounds(size_t index) {
477 gfx::Rect bounds((*windows_)[index]->bounds()); 478 gfx::Rect bounds((*windows_)[index]->bounds());
478 bounds.Inset(-kWindowOverviewSelectionPadding, 479 bounds.Inset(-kWindowOverviewSelectionPadding,
479 -kWindowOverviewSelectionPadding); 480 -kWindowOverviewSelectionPadding);
480 return bounds; 481 return bounds;
481 } 482 }
482 483
483 } // namespace ash 484 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698