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

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: 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 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 host_->CandidateWindowUpdated(); 1521 host_->CandidateWindowUpdated();
1522 } 1522 }
1523 1523
1524 void RenderWidgetHostViewAura::OnCandidateWindowHidden() { 1524 void RenderWidgetHostViewAura::OnCandidateWindowHidden() {
1525 host_->CandidateWindowHidden(); 1525 host_->CandidateWindowHidden();
1526 } 1526 }
1527 1527
1528 //////////////////////////////////////////////////////////////////////////////// 1528 ////////////////////////////////////////////////////////////////////////////////
1529 // RenderWidgetHostViewAura, gfx::DisplayObserver implementation: 1529 // RenderWidgetHostViewAura, gfx::DisplayObserver implementation:
1530 1530
1531 void RenderWidgetHostViewAura::OnDisplayBoundsChanged(
1532 const gfx::Display& display) {
1533 gfx::Screen* screen = gfx::Screen::GetScreenFor(window_);
1534 if (display.id() == screen->GetDisplayNearestWindow(window_).id()) {
1535 UpdateScreenInfo(window_);
1536 current_cursor_.SetDisplayInfo(display);
1537 UpdateCursorIfOverSelf();
1538 }
1539 }
1540
1541 void RenderWidgetHostViewAura::OnDisplayAdded( 1531 void RenderWidgetHostViewAura::OnDisplayAdded(
1542 const gfx::Display& new_display) { 1532 const gfx::Display& new_display) {
1543 } 1533 }
1544 1534
1545 void RenderWidgetHostViewAura::OnDisplayRemoved( 1535 void RenderWidgetHostViewAura::OnDisplayRemoved(
1546 const gfx::Display& old_display) { 1536 const gfx::Display& old_display) {
1547 } 1537 }
1548 1538
1539 void RenderWidgetHostViewAura::OnDisplayMetricsChanged(
1540 const gfx::Display& display, uint32_t metrics) {
1541 // The screen info should be updated regardless of the metric change.
1542 gfx::Screen* screen = gfx::Screen::GetScreenFor(window_);
1543 if (display.id() == screen->GetDisplayNearestWindow(window_).id()) {
1544 UpdateScreenInfo(window_);
1545 current_cursor_.SetDisplayInfo(display);
1546 UpdateCursorIfOverSelf();
1547 }
1548 }
1549
1549 //////////////////////////////////////////////////////////////////////////////// 1550 ////////////////////////////////////////////////////////////////////////////////
1550 // RenderWidgetHostViewAura, aura::WindowDelegate implementation: 1551 // RenderWidgetHostViewAura, aura::WindowDelegate implementation:
1551 1552
1552 gfx::Size RenderWidgetHostViewAura::GetMinimumSize() const { 1553 gfx::Size RenderWidgetHostViewAura::GetMinimumSize() const {
1553 return gfx::Size(); 1554 return gfx::Size();
1554 } 1555 }
1555 1556
1556 gfx::Size RenderWidgetHostViewAura::GetMaximumSize() const { 1557 gfx::Size RenderWidgetHostViewAura::GetMaximumSize() const {
1557 return gfx::Size(); 1558 return gfx::Size();
1558 } 1559 }
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after
2379 2380
2380 //////////////////////////////////////////////////////////////////////////////// 2381 ////////////////////////////////////////////////////////////////////////////////
2381 // RenderWidgetHostViewBase, public: 2382 // RenderWidgetHostViewBase, public:
2382 2383
2383 // static 2384 // static
2384 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { 2385 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) {
2385 GetScreenInfoForWindow(results, NULL); 2386 GetScreenInfoForWindow(results, NULL);
2386 } 2387 }
2387 2388
2388 } // namespace content 2389 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698