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

Side by Side Diff: chrome/browser/ui/gtk/gtk_window_util.cc

Issue 10871087: GTK implementation of remembering platform app window geometry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 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 "chrome/browser/ui/gtk/gtk_window_util.h" 5 #include "chrome/browser/ui/gtk/gtk_window_util.h"
6 6
7 #include <dlfcn.h> 7 #include <dlfcn.h>
8 #include "chrome/browser/ui/base_window.h"
8 #include "content/public/browser/render_view_host.h" 9 #include "content/public/browser/render_view_host.h"
9 #include "content/public/browser/web_contents.h" 10 #include "content/public/browser/web_contents.h"
10 11
11 using content::RenderWidgetHost; 12 using content::RenderWidgetHost;
12 using content::WebContents; 13 using content::WebContents;
13 14
14 namespace gtk_window_util { 15 namespace gtk_window_util {
15 16
16 // Keep track of the last click time and the last click position so we can 17 // Keep track of the last click time and the last click position so we can
17 // filter out extra GDK_BUTTON_PRESS events when a double click happens. 18 // filter out extra GDK_BUTTON_PRESS events when a double click happens.
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 } 235 }
235 if (size_with_decorations.height > current_height) { 236 if (size_with_decorations.height > current_height) {
236 new_size.set_height(size.height() - size_with_decorations.height + 237 new_size.set_height(size.height() - size_with_decorations.height +
237 current_height); 238 current_height);
238 } 239 }
239 } 240 }
240 241
241 gtk_window_resize(window, new_size.width(), new_size.height()); 242 gtk_window_resize(window, new_size.width(), new_size.height());
242 } 243 }
243 244
245 void UpdateWindowPosition(BaseWindow* window,
246 gfx::Rect* bounds,
247 gfx::Rect* restored_bounds) {
248 gint x, y;
249 gtk_window_get_position(window->GetNativeWindow(), &x, &y);
250 (*bounds).set_origin(gfx::Point(x, y));
251 if (!window->IsFullscreen() && !window->IsMaximized())
252 *restored_bounds = *bounds;
253 }
254
244 } // namespace gtk_window_util 255 } // namespace gtk_window_util
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/gtk_window_util.h ('k') | chrome/test/data/extensions/platform_apps/geometry/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698