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

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: jochen comments (inc. git cl format) 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 291
292 // TODO(flackr): StopPropogation prevents generation of gesture events. 292 // TODO(flackr): StopPropogation prevents generation of gesture events.
293 // We should find a better way to prevent events from being delivered to 293 // We should find a better way to prevent events from being delivered to
294 // the window, perhaps a transparent window in front of the target window 294 // the window, perhaps a transparent window in front of the target window
295 // or using EventClientImpl::CanProcessEventsWithinSubtree and then a tap 295 // or using EventClientImpl::CanProcessEventsWithinSubtree and then a tap
296 // gesture could be used to activate the window. 296 // gesture could be used to activate the window.
297 event->SetHandled(); 297 event->SetHandled();
298 window_selector_->SelectWindow(target); 298 window_selector_->SelectWindow(target);
299 } 299 }
300 300
301 void WindowOverview::OnDisplayBoundsChanged(const gfx::Display& display) {
302 PositionWindows(/* animate */ false);
303 }
304
305 void WindowOverview::OnDisplayAdded(const gfx::Display& display) { 301 void WindowOverview::OnDisplayAdded(const gfx::Display& display) {
306 } 302 }
307 303
308 void WindowOverview::OnDisplayRemoved(const gfx::Display& display) { 304 void WindowOverview::OnDisplayRemoved(const gfx::Display& display) {
309 } 305 }
310 306
307 void WindowOverview::OnDisplayMetricsChanged(
308 const gfx::Display& display,
309 gfx::DisplayObserver::DisplayMetrics metrics) {
310 PositionWindows(/* animate */ false);
311 }
312
311 aura::Window* WindowOverview::GetEventTarget(ui::LocatedEvent* event) { 313 aura::Window* WindowOverview::GetEventTarget(ui::LocatedEvent* event) {
312 aura::Window* target = static_cast<aura::Window*>(event->target()); 314 aura::Window* target = static_cast<aura::Window*>(event->target());
313 // If the target window doesn't actually contain the event location (i.e. 315 // If the target window doesn't actually contain the event location (i.e.
314 // mouse down over the window and mouse up elsewhere) then do not select the 316 // mouse down over the window and mouse up elsewhere) then do not select the
315 // window. 317 // window.
316 if (!target->ContainsPoint(event->location())) 318 if (!target->ContainsPoint(event->location()))
317 return NULL; 319 return NULL;
318 320
319 return GetTargetedWindow(target); 321 return GetTargetedWindow(target);
320 } 322 }
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 } 450 }
449 451
450 gfx::Rect WindowOverview::GetSelectionBounds(size_t index) { 452 gfx::Rect WindowOverview::GetSelectionBounds(size_t index) {
451 gfx::Rect bounds((*windows_)[index]->bounds()); 453 gfx::Rect bounds((*windows_)[index]->bounds());
452 bounds.Inset(-kWindowOverviewSelectionPadding, 454 bounds.Inset(-kWindowOverviewSelectionPadding,
453 -kWindowOverviewSelectionPadding); 455 -kWindowOverviewSelectionPadding);
454 return bounds; 456 return bounds;
455 } 457 }
456 458
457 } // namespace ash 459 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698