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

Side by Side Diff: mojo/services/native_viewport/native_viewport_win.cc

Issue 347433003: Fix incorrect position of Native Viewport contents on Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 6 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 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 "mojo/services/native_viewport/native_viewport.h" 5 #include "mojo/services/native_viewport/native_viewport.h"
6 6
7 #include "ui/events/event.h" 7 #include "ui/events/event.h"
8 #include "ui/gfx/win/msg_util.h" 8 #include "ui/gfx/win/msg_util.h"
9 #include "ui/gfx/win/window_impl.h" 9 #include "ui/gfx/win/window_impl.h"
10 10
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 HBRUSH red_brush = CreateSolidBrush(RGB(255, 0, 0)); 136 HBRUSH red_brush = CreateSolidBrush(RGB(255, 0, 0));
137 HGDIOBJ old_object = SelectObject(dc, red_brush); 137 HGDIOBJ old_object = SelectObject(dc, red_brush);
138 Rectangle(dc, cr.left, cr.top, cr.right, cr.bottom); 138 Rectangle(dc, cr.left, cr.top, cr.right, cr.bottom);
139 SelectObject(dc, old_object); 139 SelectObject(dc, old_object);
140 DeleteObject(red_brush); 140 DeleteObject(red_brush);
141 EndPaint(hwnd(), &ps); 141 EndPaint(hwnd(), &ps);
142 } 142 }
143 void OnWindowPosChanged(WINDOWPOS* window_pos) { 143 void OnWindowPosChanged(WINDOWPOS* window_pos) {
144 if (!(window_pos->flags & SWP_NOSIZE) || 144 if (!(window_pos->flags & SWP_NOSIZE) ||
145 !(window_pos->flags & SWP_NOMOVE)) { 145 !(window_pos->flags & SWP_NOMOVE)) {
146 delegate_->OnBoundsChanged(gfx::Rect(window_pos->x, window_pos->y, 146 RECT cr;
147 window_pos->cx, window_pos->cy)); 147 GetClientRect(hwnd(), &cr);
148 delegate_->OnBoundsChanged(
149 gfx::Rect(window_pos->x, window_pos->y,
150 cr.right - cr.left, cr.bottom - cr.top));
148 } 151 }
149 } 152 }
150 153
151 NativeViewportDelegate* delegate_; 154 NativeViewportDelegate* delegate_;
152 155
153 DISALLOW_COPY_AND_ASSIGN(NativeViewportWin); 156 DISALLOW_COPY_AND_ASSIGN(NativeViewportWin);
154 }; 157 };
155 158
156 // static 159 // static
157 scoped_ptr<NativeViewport> NativeViewport::Create( 160 scoped_ptr<NativeViewport> NativeViewport::Create(
158 shell::Context* context, 161 shell::Context* context,
159 NativeViewportDelegate* delegate) { 162 NativeViewportDelegate* delegate) {
160 return scoped_ptr<NativeViewport>(new NativeViewportWin(delegate)).Pass(); 163 return scoped_ptr<NativeViewport>(new NativeViewportWin(delegate)).Pass();
161 } 164 }
162 165
163 } // namespace services 166 } // namespace services
164 } // namespace mojo 167 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/examples/window_manager/window_manager.cc ('k') | mojo/services/view_manager/window_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698