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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 const SkBitmap& image, |
224 const gfx::Point& image_offset) { | 224 const gfx::Point& image_offset) { |
225 drag_source_->StartDragging(drop_data, &last_mouse_down_, | 225 drag_source_->StartDragging(drop_data, ops, &last_mouse_down_, |
226 image, image_offset); | 226 image, image_offset); |
227 // TODO(snej): Make use of WebDragOperationsMask | |
228 } | 227 } |
229 | 228 |
230 void TabContentsViewGtk::SetPageTitle(const std::wstring& title) { | 229 void TabContentsViewGtk::SetPageTitle(const std::wstring& title) { |
231 // Set the window name to include the page title so it's easier to spot | 230 // Set the window name to include the page title so it's easier to spot |
232 // when debugging (e.g. via xwininfo -tree). | 231 // when debugging (e.g. via xwininfo -tree). |
233 gfx::NativeView content_view = GetContentNativeView(); | 232 gfx::NativeView content_view = GetContentNativeView(); |
234 if (content_view && content_view->window) | 233 if (content_view && content_view->window) |
235 gdk_window_set_title(content_view->window, WideToUTF8(title).c_str()); | 234 gdk_window_set_title(content_view->window, WideToUTF8(title).c_str()); |
236 } | 235 } |
237 | 236 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 // not NULL, else our delegate. | 440 // not NULL, else our delegate. |
442 gboolean TabContentsViewGtk::OnMouseMove(GtkWidget* widget, | 441 gboolean TabContentsViewGtk::OnMouseMove(GtkWidget* widget, |
443 GdkEventMotion* event) { | 442 GdkEventMotion* event) { |
444 if (sad_tab_ != NULL) | 443 if (sad_tab_ != NULL) |
445 WidgetGtk::OnMotionNotify(widget, event); | 444 WidgetGtk::OnMotionNotify(widget, event); |
446 else if (tab_contents()->delegate()) | 445 else if (tab_contents()->delegate()) |
447 tab_contents()->delegate()->ContentsMouseEvent( | 446 tab_contents()->delegate()->ContentsMouseEvent( |
448 tab_contents(), views::Screen::GetCursorScreenPoint(), true); | 447 tab_contents(), views::Screen::GetCursorScreenPoint(), true); |
449 return FALSE; | 448 return FALSE; |
450 } | 449 } |
OLD | NEW |