OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/tab_contents/tab_contents_view_gtk.h" | 5 #include "chrome/browser/views/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 "app/gfx/canvas_paint.h" | 10 #include "app/gfx/canvas_paint.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 void TabContentsViewGtk::GetContainerBounds(gfx::Rect* out) const { | 212 void TabContentsViewGtk::GetContainerBounds(gfx::Rect* out) const { |
213 GetBounds(out, false); | 213 GetBounds(out, false); |
214 | 214 |
215 // Callers expect the requested bounds not the actual bounds. For example, | 215 // Callers expect the requested bounds not the actual bounds. For example, |
216 // during init callers expect 0x0, but Gtk layout enforces a min size of 1x1. | 216 // during init callers expect 0x0, but Gtk layout enforces a min size of 1x1. |
217 out->set_width(GetNativeView()->requisition.width); | 217 out->set_width(GetNativeView()->requisition.width); |
218 out->set_height(GetNativeView()->requisition.height); | 218 out->set_height(GetNativeView()->requisition.height); |
219 } | 219 } |
220 | 220 |
221 void TabContentsViewGtk::StartDragging(const WebDropData& drop_data, | 221 void TabContentsViewGtk::StartDragging(const WebDropData& drop_data, |
222 WebDragOperationsMask ops, | 222 WebDragOperationsMask ops) { |
223 const SkBitmap& image, | 223 drag_source_->StartDragging(drop_data, &last_mouse_down_); |
224 const gfx::Point& image_offset) { | |
225 drag_source_->StartDragging(drop_data, &last_mouse_down_, | |
226 image, image_offset); | |
227 // TODO(snej): Make use of WebDragOperationsMask | 224 // TODO(snej): Make use of WebDragOperationsMask |
228 } | 225 } |
229 | 226 |
230 void TabContentsViewGtk::SetPageTitle(const std::wstring& title) { | 227 void TabContentsViewGtk::SetPageTitle(const std::wstring& title) { |
231 // Set the window name to include the page title so it's easier to spot | 228 // Set the window name to include the page title so it's easier to spot |
232 // when debugging (e.g. via xwininfo -tree). | 229 // when debugging (e.g. via xwininfo -tree). |
233 gfx::NativeView content_view = GetContentNativeView(); | 230 gfx::NativeView content_view = GetContentNativeView(); |
234 if (content_view && content_view->window) | 231 if (content_view && content_view->window) |
235 gdk_window_set_title(content_view->window, WideToUTF8(title).c_str()); | 232 gdk_window_set_title(content_view->window, WideToUTF8(title).c_str()); |
236 } | 233 } |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 // not NULL, else our delegate. | 429 // not NULL, else our delegate. |
433 gboolean TabContentsViewGtk::OnMouseMove(GtkWidget* widget, | 430 gboolean TabContentsViewGtk::OnMouseMove(GtkWidget* widget, |
434 GdkEventMotion* event) { | 431 GdkEventMotion* event) { |
435 if (sad_tab_ != NULL) | 432 if (sad_tab_ != NULL) |
436 WidgetGtk::OnMotionNotify(widget, event); | 433 WidgetGtk::OnMotionNotify(widget, event); |
437 else if (tab_contents()->delegate()) | 434 else if (tab_contents()->delegate()) |
438 tab_contents()->delegate()->ContentsMouseEvent( | 435 tab_contents()->delegate()->ContentsMouseEvent( |
439 tab_contents(), views::Screen::GetCursorScreenPoint(), true); | 436 tab_contents(), views::Screen::GetCursorScreenPoint(), true); |
440 return FALSE; | 437 return FALSE; |
441 } | 438 } |
OLD | NEW |