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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.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 (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 "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after
1524 host_->CandidateWindowUpdated(); 1524 host_->CandidateWindowUpdated();
1525 } 1525 }
1526 1526
1527 void RenderWidgetHostViewAura::OnCandidateWindowHidden() { 1527 void RenderWidgetHostViewAura::OnCandidateWindowHidden() {
1528 host_->CandidateWindowHidden(); 1528 host_->CandidateWindowHidden();
1529 } 1529 }
1530 1530
1531 //////////////////////////////////////////////////////////////////////////////// 1531 ////////////////////////////////////////////////////////////////////////////////
1532 // RenderWidgetHostViewAura, gfx::DisplayObserver implementation: 1532 // RenderWidgetHostViewAura, gfx::DisplayObserver implementation:
1533 1533
1534 void RenderWidgetHostViewAura::OnDisplayBoundsChanged(
1535 const gfx::Display& display) {
1536 gfx::Screen* screen = gfx::Screen::GetScreenFor(window_);
1537 if (display.id() == screen->GetDisplayNearestWindow(window_).id()) {
1538 UpdateScreenInfo(window_);
1539 current_cursor_.SetDisplayInfo(display);
1540 UpdateCursorIfOverSelf();
1541 }
1542 }
1543
1544 void RenderWidgetHostViewAura::OnDisplayAdded( 1534 void RenderWidgetHostViewAura::OnDisplayAdded(
1545 const gfx::Display& new_display) { 1535 const gfx::Display& new_display) {
1546 } 1536 }
1547 1537
1548 void RenderWidgetHostViewAura::OnDisplayRemoved( 1538 void RenderWidgetHostViewAura::OnDisplayRemoved(
1549 const gfx::Display& old_display) { 1539 const gfx::Display& old_display) {
1550 } 1540 }
1551 1541
1542 void RenderWidgetHostViewAura::OnDisplayMetricsChanged(
1543 const gfx::Display& display,
1544 DisplayObserver::DisplayMetrics metrics) {
1545 // The screen info should be updated regardless of the metric change.
1546 gfx::Screen* screen = gfx::Screen::GetScreenFor(window_);
1547 if (display.id() == screen->GetDisplayNearestWindow(window_).id()) {
1548 UpdateScreenInfo(window_);
1549 current_cursor_.SetDisplayInfo(display);
1550 UpdateCursorIfOverSelf();
1551 }
1552 }
1553
1552 //////////////////////////////////////////////////////////////////////////////// 1554 ////////////////////////////////////////////////////////////////////////////////
1553 // RenderWidgetHostViewAura, aura::WindowDelegate implementation: 1555 // RenderWidgetHostViewAura, aura::WindowDelegate implementation:
1554 1556
1555 gfx::Size RenderWidgetHostViewAura::GetMinimumSize() const { 1557 gfx::Size RenderWidgetHostViewAura::GetMinimumSize() const {
1556 return gfx::Size(); 1558 return gfx::Size();
1557 } 1559 }
1558 1560
1559 gfx::Size RenderWidgetHostViewAura::GetMaximumSize() const { 1561 gfx::Size RenderWidgetHostViewAura::GetMaximumSize() const {
1560 return gfx::Size(); 1562 return gfx::Size();
1561 } 1563 }
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after
2382 2384
2383 //////////////////////////////////////////////////////////////////////////////// 2385 ////////////////////////////////////////////////////////////////////////////////
2384 // RenderWidgetHostViewBase, public: 2386 // RenderWidgetHostViewBase, public:
2385 2387
2386 // static 2388 // static
2387 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { 2389 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) {
2388 GetScreenInfoForWindow(results, NULL); 2390 GetScreenInfoForWindow(results, NULL);
2389 } 2391 }
2390 2392
2391 } // namespace content 2393 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698