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

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

Issue 7717011: Get rid of static TabContentsView::Create function since the interface is in content, but the imp... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fix mac build Created 9 years, 4 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 tab_contents->delegate()->ContentsZoomChange(true); 71 tab_contents->delegate()->ContentsZoomChange(true);
72 return TRUE; 72 return TRUE;
73 } 73 }
74 } 74 }
75 75
76 return FALSE; 76 return FALSE;
77 } 77 }
78 78
79 } // namespace 79 } // namespace
80 80
81 // static
82 TabContentsView* TabContentsView::Create(TabContents* tab_contents) {
83 return new TabContentsViewGtk(tab_contents);
84 }
85
86 TabContentsViewGtk::TabContentsViewGtk(TabContents* tab_contents) 81 TabContentsViewGtk::TabContentsViewGtk(TabContents* tab_contents)
87 : tab_contents_(tab_contents), 82 : tab_contents_(tab_contents),
88 floating_(gtk_floating_container_new()), 83 floating_(gtk_floating_container_new()),
89 expanded_(gtk_expanded_container_new()), 84 expanded_(gtk_expanded_container_new()),
90 constrained_window_(NULL) { 85 constrained_window_(NULL) {
91 gtk_widget_set_name(expanded_, "chrome-tab-contents-view"); 86 gtk_widget_set_name(expanded_, "chrome-tab-contents-view");
92 g_signal_connect(expanded_, "size-allocate", 87 g_signal_connect(expanded_, "size-allocate",
93 G_CALLBACK(OnSizeAllocateThunk), this); 88 G_CALLBACK(OnSizeAllocateThunk), this);
94 g_signal_connect(expanded_, "child-size-request", 89 g_signal_connect(expanded_, "child-size-request",
95 G_CALLBACK(OnChildSizeRequestThunk), this); 90 G_CALLBACK(OnChildSizeRequestThunk), this);
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 g_value_set_int(&value, child_x); 499 g_value_set_int(&value, child_x);
505 gtk_container_child_set_property(GTK_CONTAINER(floating_container), 500 gtk_container_child_set_property(GTK_CONTAINER(floating_container),
506 widget, "x", &value); 501 widget, "x", &value);
507 502
508 int child_y = std::max((allocation->height - requisition.height) / 2, 0); 503 int child_y = std::max((allocation->height - requisition.height) / 2, 0);
509 g_value_set_int(&value, child_y); 504 g_value_set_int(&value, child_y);
510 gtk_container_child_set_property(GTK_CONTAINER(floating_container), 505 gtk_container_child_set_property(GTK_CONTAINER(floating_container),
511 widget, "y", &value); 506 widget, "y", &value);
512 g_value_unset(&value); 507 g_value_unset(&value);
513 } 508 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/tab_contents/tab_contents_view_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698