| OLD | NEW |
| 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/ui/views/tab_contents/native_tab_contents_view_gtk.h" | 5 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/tab_contents/web_drag_dest_gtk.h" | 8 #include "chrome/browser/tab_contents/web_drag_dest_gtk.h" |
| 9 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" | 9 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" |
| 10 #include "chrome/browser/ui/gtk/tab_contents_drag_source.h" | 10 #include "chrome/browser/ui/gtk/tab_contents_drag_source.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 0); | 140 0); |
| 141 return view; | 141 return view; |
| 142 } | 142 } |
| 143 | 143 |
| 144 gfx::NativeWindow NativeTabContentsViewGtk::GetTopLevelNativeWindow() const { | 144 gfx::NativeWindow NativeTabContentsViewGtk::GetTopLevelNativeWindow() const { |
| 145 GtkWidget* window = gtk_widget_get_ancestor(GetWidget()->GetNativeView(), | 145 GtkWidget* window = gtk_widget_get_ancestor(GetWidget()->GetNativeView(), |
| 146 GTK_TYPE_WINDOW); | 146 GTK_TYPE_WINDOW); |
| 147 return window ? GTK_WINDOW(window) : NULL; | 147 return window ? GTK_WINDOW(window) : NULL; |
| 148 } | 148 } |
| 149 | 149 |
| 150 void NativeTabContentsViewGtk::SetPageTitle(const std::wstring& title) { | 150 void NativeTabContentsViewGtk::SetPageTitle(const string16& title) { |
| 151 // Set the window name to include the page title so it's easier to spot | 151 // Set the window name to include the page title so it's easier to spot |
| 152 // when debugging (e.g. via xwininfo -tree). | 152 // when debugging (e.g. via xwininfo -tree). |
| 153 if (GDK_IS_WINDOW(GetNativeView()->window)) | 153 if (GDK_IS_WINDOW(GetNativeView()->window)) |
| 154 gdk_window_set_title(GetNativeView()->window, WideToUTF8(title).c_str()); | 154 gdk_window_set_title(GetNativeView()->window, UTF16ToUTF8(title).c_str()); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void NativeTabContentsViewGtk::StartDragging(const WebDropData& drop_data, | 157 void NativeTabContentsViewGtk::StartDragging(const WebDropData& drop_data, |
| 158 WebKit::WebDragOperationsMask ops, | 158 WebKit::WebDragOperationsMask ops, |
| 159 const SkBitmap& image, | 159 const SkBitmap& image, |
| 160 const gfx::Point& image_offset) { | 160 const gfx::Point& image_offset) { |
| 161 drag_source_->StartDragging(drop_data, ops, &last_mouse_down_, | 161 drag_source_->StartDragging(drop_data, ops, &last_mouse_down_, |
| 162 image, image_offset); | 162 image, image_offset); |
| 163 } | 163 } |
| 164 | 164 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 // NativeTabContentsView, public: | 260 // NativeTabContentsView, public: |
| 261 | 261 |
| 262 // static | 262 // static |
| 263 NativeTabContentsView* NativeTabContentsView::CreateNativeTabContentsView( | 263 NativeTabContentsView* NativeTabContentsView::CreateNativeTabContentsView( |
| 264 internal::NativeTabContentsViewDelegate* delegate) { | 264 internal::NativeTabContentsViewDelegate* delegate) { |
| 265 if (views::Widget::IsPureViews() && | 265 if (views::Widget::IsPureViews() && |
| 266 views::ViewsDelegate::views_delegate->GetDefaultParentView()) | 266 views::ViewsDelegate::views_delegate->GetDefaultParentView()) |
| 267 return new NativeTabContentsViewViews(delegate); | 267 return new NativeTabContentsViewViews(delegate); |
| 268 return new NativeTabContentsViewGtk(delegate); | 268 return new NativeTabContentsViewGtk(delegate); |
| 269 } | 269 } |
| OLD | NEW |