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

Side by Side Diff: chrome/browser/tab_contents/tab_contents_view_gtk.cc

Issue 458013: Make the default RendererPreferences smarter.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/tab_contents/tab_contents_view_gtk.h" 5 #include "chrome/browser/tab_contents/tab_contents_view_gtk.h"
6 6
7 #include <gdk/gdk.h> 7 #include <gdk/gdk.h>
8 #include <gdk/gdkkeysyms.h> 8 #include <gdk/gdkkeysyms.h>
9 #include <gtk/gtk.h> 9 #include <gtk/gtk.h>
10 10
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 if (!tab_contents()->render_widget_host_view()) 227 if (!tab_contents()->render_widget_host_view())
228 return NULL; 228 return NULL;
229 return tab_contents()->render_widget_host_view()->GetNativeView(); 229 return tab_contents()->render_widget_host_view()->GetNativeView();
230 } 230 }
231 231
232 gfx::NativeWindow TabContentsViewGtk::GetTopLevelNativeWindow() const { 232 gfx::NativeWindow TabContentsViewGtk::GetTopLevelNativeWindow() const {
233 GtkWidget* window = gtk_widget_get_ancestor(GetNativeView(), GTK_TYPE_WINDOW); 233 GtkWidget* window = gtk_widget_get_ancestor(GetNativeView(), GTK_TYPE_WINDOW);
234 return window ? GTK_WINDOW(window) : NULL; 234 return window ? GTK_WINDOW(window) : NULL;
235 } 235 }
236 236
237 void TabContentsViewGtk::InitRendererPrefs(RendererPreferences* prefs) {
238 gtk_util::InitRendererPrefsFromGtkSettings(prefs);
239 }
240
241 void TabContentsViewGtk::GetContainerBounds(gfx::Rect* out) const { 237 void TabContentsViewGtk::GetContainerBounds(gfx::Rect* out) const {
242 // This is used for positioning the download shelf arrow animation, 238 // This is used for positioning the download shelf arrow animation,
243 // as well as sizing some other widgets in Windows. In GTK the size is 239 // as well as sizing some other widgets in Windows. In GTK the size is
244 // managed for us, so it appears to be only used for the download shelf 240 // managed for us, so it appears to be only used for the download shelf
245 // animation. 241 // animation.
246 int x = 0; 242 int x = 0;
247 int y = 0; 243 int y = 0;
248 if (fixed_->window) 244 if (fixed_->window)
249 gdk_window_get_origin(fixed_->window, &x, &y); 245 gdk_window_get_origin(fixed_->window, &x, &y);
250 out->SetRect(x + fixed_->allocation.x, y + fixed_->allocation.y, 246 out->SetRect(x + fixed_->allocation.x, y + fixed_->allocation.y,
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 gtk_container_child_set_property(GTK_CONTAINER(floating_container), 473 gtk_container_child_set_property(GTK_CONTAINER(floating_container),
478 widget, "x", &value); 474 widget, "x", &value);
479 475
480 int child_y = std::max(half_view_height - (requisition.height / 2), 0); 476 int child_y = std::max(half_view_height - (requisition.height / 2), 0);
481 g_value_set_int(&value, child_y); 477 g_value_set_int(&value, child_y);
482 gtk_container_child_set_property(GTK_CONTAINER(floating_container), 478 gtk_container_child_set_property(GTK_CONTAINER(floating_container),
483 widget, "y", &value); 479 widget, "y", &value);
484 g_value_unset(&value); 480 g_value_unset(&value);
485 } 481 }
486 } 482 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/tab_contents_view_gtk.h ('k') | chrome/browser/views/notifications/balloon_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698