OLD | NEW |
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 <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 Source<TabContents>(tab_contents)); | 90 Source<TabContents>(tab_contents)); |
91 registrar_.Add(this, NotificationType::TAB_CONTENTS_DISCONNECTED, | 91 registrar_.Add(this, NotificationType::TAB_CONTENTS_DISCONNECTED, |
92 Source<TabContents>(tab_contents)); | 92 Source<TabContents>(tab_contents)); |
93 } | 93 } |
94 | 94 |
95 TabContentsViewGtk::~TabContentsViewGtk() { | 95 TabContentsViewGtk::~TabContentsViewGtk() { |
96 vbox_.Destroy(); | 96 vbox_.Destroy(); |
97 } | 97 } |
98 | 98 |
99 void TabContentsViewGtk::CreateView() { | 99 void TabContentsViewGtk::CreateView() { |
100 NOTIMPLEMENTED(); | 100 // Windows uses this to do initialization, but we do all our initialization |
| 101 // in the constructor. |
101 } | 102 } |
102 | 103 |
103 RenderWidgetHostView* TabContentsViewGtk::CreateViewForWidget( | 104 RenderWidgetHostView* TabContentsViewGtk::CreateViewForWidget( |
104 RenderWidgetHost* render_widget_host) { | 105 RenderWidgetHost* render_widget_host) { |
105 if (render_widget_host->view()) { | 106 if (render_widget_host->view()) { |
106 // During testing, the view will already be set up in most cases to the | 107 // During testing, the view will already be set up in most cases to the |
107 // test view, so we don't want to clobber it with a real one. To verify that | 108 // test view, so we don't want to clobber it with a real one. To verify that |
108 // this actually is happening (and somebody isn't accidentally creating the | 109 // this actually is happening (and somebody isn't accidentally creating the |
109 // view twice), we check for the RVH Factory, which will be set when we're | 110 // view twice), we check for the RVH Factory, which will be set when we're |
110 // making special ones (which go along with the special views). | 111 // making special ones (which go along with the special views). |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 gfx::NativeView content_view = GetContentNativeView(); | 172 gfx::NativeView content_view = GetContentNativeView(); |
172 if (content_view && content_view->window) | 173 if (content_view && content_view->window) |
173 gdk_window_set_title(content_view->window, WideToUTF8(title).c_str()); | 174 gdk_window_set_title(content_view->window, WideToUTF8(title).c_str()); |
174 } | 175 } |
175 | 176 |
176 void TabContentsViewGtk::Invalidate() { | 177 void TabContentsViewGtk::Invalidate() { |
177 gtk_widget_queue_draw(sad_tab_->widget()); | 178 gtk_widget_queue_draw(sad_tab_->widget()); |
178 } | 179 } |
179 | 180 |
180 void TabContentsViewGtk::SizeContents(const gfx::Size& size) { | 181 void TabContentsViewGtk::SizeContents(const gfx::Size& size) { |
181 NOTIMPLEMENTED(); | 182 // This function is a hack and should go away. In any case we don't manually |
| 183 // control the size of the contents on linux, so do nothing. |
182 } | 184 } |
183 | 185 |
184 void TabContentsViewGtk::FindInPage(const Browser& browser, | 186 void TabContentsViewGtk::FindInPage(const Browser& browser, |
185 bool find_next, bool forward_direction) { | 187 bool find_next, bool forward_direction) { |
186 NOTIMPLEMENTED(); | 188 NOTIMPLEMENTED(); |
187 } | 189 } |
188 | 190 |
189 void TabContentsViewGtk::HideFindBar(bool end_session) { | 191 void TabContentsViewGtk::HideFindBar(bool end_session) { |
190 NOTIMPLEMENTED(); | 192 NOTIMPLEMENTED(); |
191 } | 193 } |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 int width = allocation->width; | 322 int width = allocation->width; |
321 DownloadShelf* shelf = view->tab_contents()->GetDownloadShelf(false); | 323 DownloadShelf* shelf = view->tab_contents()->GetDownloadShelf(false); |
322 int height = shelf && shelf->IsClosing() ? | 324 int height = shelf && shelf->IsClosing() ? |
323 widget->parent->allocation.height : allocation->height; | 325 widget->parent->allocation.height : allocation->height; |
324 height += view->tab_contents()->delegate()->GetExtraRenderViewHeight(); | 326 height += view->tab_contents()->delegate()->GetExtraRenderViewHeight(); |
325 gfx::Size size(width, height); | 327 gfx::Size size(width, height); |
326 gtk_container_foreach(GTK_CONTAINER(widget), SetSizeRequest, &size); | 328 gtk_container_foreach(GTK_CONTAINER(widget), SetSizeRequest, &size); |
327 | 329 |
328 return FALSE; | 330 return FALSE; |
329 } | 331 } |
OLD | NEW |