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

Side by Side Diff: ui/views/widget/desktop_native_widget_helper_aura.cc

Issue 10210005: Ash/aura split: NativeWidgetAura::GetWindowScreenBounds() should return screen bounds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
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 "ui/views/widget/desktop_native_widget_helper_aura.h" 5 #include "ui/views/widget/desktop_native_widget_helper_aura.h"
6 6
7 #include "ui/views/widget/native_widget_aura.h" 7 #include "ui/views/widget/native_widget_aura.h"
8 #include "ui/aura/root_window.h" 8 #include "ui/aura/root_window.h"
9 #include "ui/aura/desktop/desktop_activation_client.h" 9 #include "ui/aura/desktop/desktop_activation_client.h"
10 #include "ui/aura/desktop/desktop_dispatcher_client.h" 10 #include "ui/aura/desktop/desktop_dispatcher_client.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 gfx::Rect DesktopNativeWidgetHelperAura::ModifyAndSetBounds(gfx::Rect bounds) { 52 gfx::Rect DesktopNativeWidgetHelperAura::ModifyAndSetBounds(gfx::Rect bounds) {
53 if (root_window_.get() && !bounds.IsEmpty()) { 53 if (root_window_.get() && !bounds.IsEmpty()) {
54 root_window_->SetHostBounds(bounds); 54 root_window_->SetHostBounds(bounds);
55 bounds.set_x(0); 55 bounds.set_x(0);
56 bounds.set_y(0); 56 bounds.set_y(0);
57 } 57 }
58 58
59 return bounds; 59 return bounds;
60 } 60 }
61 61
62 gfx::Rect DesktopNativeWidgetHelperAura::ChangeRootWindowBoundsToScreenBounds(
63 gfx::Rect bounds) {
64 if (root_window_.get())
65 bounds.Offset(root_window_->GetHostOrigin());
66 return bounds;
67 }
68
62 //////////////////////////////////////////////////////////////////////////////// 69 ////////////////////////////////////////////////////////////////////////////////
63 // DesktopNativeWidgetHelperAura, aura::RootWindowObserver implementation: 70 // DesktopNativeWidgetHelperAura, aura::RootWindowObserver implementation:
64 71
65 void DesktopNativeWidgetHelperAura::OnRootWindowResized( 72 void DesktopNativeWidgetHelperAura::OnRootWindowResized(
66 const aura::RootWindow* root, 73 const aura::RootWindow* root,
67 const gfx::Size& old_size) { 74 const gfx::Size& old_size) {
68 DCHECK_EQ(root, root_window_.get()); 75 DCHECK_EQ(root, root_window_.get());
69 widget_->SetBounds(gfx::Rect(root->GetHostSize())); 76 widget_->SetBounds(gfx::Rect(root->GetHostSize()));
70 } 77 }
71 78
72 void DesktopNativeWidgetHelperAura::OnRootWindowHostClosed( 79 void DesktopNativeWidgetHelperAura::OnRootWindowHostClosed(
73 const aura::RootWindow* root) { 80 const aura::RootWindow* root) {
74 DCHECK_EQ(root, root_window_.get()); 81 DCHECK_EQ(root, root_window_.get());
75 widget_->GetWidget()->Close(); 82 widget_->GetWidget()->Close();
76 } 83 }
77 84
78 } // namespace views 85 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698