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_win.h" | 5 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.h" |
6 | 6 |
7 #include "chrome/browser/tab_contents/web_drop_target_win.h" | 7 #include "chrome/browser/tab_contents/web_drop_target_win.h" |
8 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate
.h" | 8 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate
.h" |
9 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_views.h" | 9 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_views.h" |
10 #include "chrome/browser/ui/views/tab_contents/tab_contents_drag_win.h" | 10 #include "chrome/browser/ui/views/tab_contents/tab_contents_drag_win.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 new RenderWidgetHostViewWin(render_widget_host); | 122 new RenderWidgetHostViewWin(render_widget_host); |
123 view->CreateWnd(GetNativeView()); | 123 view->CreateWnd(GetNativeView()); |
124 view->ShowWindow(SW_SHOW); | 124 view->ShowWindow(SW_SHOW); |
125 return view; | 125 return view; |
126 } | 126 } |
127 | 127 |
128 gfx::NativeWindow NativeTabContentsViewWin::GetTopLevelNativeWindow() const { | 128 gfx::NativeWindow NativeTabContentsViewWin::GetTopLevelNativeWindow() const { |
129 return ::GetAncestor(GetNativeView(), GA_ROOT); | 129 return ::GetAncestor(GetNativeView(), GA_ROOT); |
130 } | 130 } |
131 | 131 |
132 void NativeTabContentsViewWin::SetPageTitle(const std::wstring& title) { | 132 void NativeTabContentsViewWin::SetPageTitle(const string16& title) { |
133 // It's possible to get this after the hwnd has been destroyed. | 133 // It's possible to get this after the hwnd has been destroyed. |
134 if (GetNativeView()) | 134 if (GetNativeView()) |
135 ::SetWindowText(GetNativeView(), title.c_str()); | 135 ::SetWindowText(GetNativeView(), title.c_str()); |
136 } | 136 } |
137 | 137 |
138 void NativeTabContentsViewWin::StartDragging(const WebDropData& drop_data, | 138 void NativeTabContentsViewWin::StartDragging(const WebDropData& drop_data, |
139 WebKit::WebDragOperationsMask ops, | 139 WebKit::WebDragOperationsMask ops, |
140 const SkBitmap& image, | 140 const SkBitmap& image, |
141 const gfx::Point& image_offset) { | 141 const gfx::Point& image_offset) { |
142 drag_handler_ = new TabContentsDragWin(this); | 142 drag_handler_ = new TabContentsDragWin(this); |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 // NativeTabContentsView, public: | 340 // NativeTabContentsView, public: |
341 | 341 |
342 // static | 342 // static |
343 NativeTabContentsView* NativeTabContentsView::CreateNativeTabContentsView( | 343 NativeTabContentsView* NativeTabContentsView::CreateNativeTabContentsView( |
344 internal::NativeTabContentsViewDelegate* delegate) { | 344 internal::NativeTabContentsViewDelegate* delegate) { |
345 if (views::Widget::IsPureViews() && | 345 if (views::Widget::IsPureViews() && |
346 views::ViewsDelegate::views_delegate->GetDefaultParentView()) | 346 views::ViewsDelegate::views_delegate->GetDefaultParentView()) |
347 return new NativeTabContentsViewViews(delegate); | 347 return new NativeTabContentsViewViews(delegate); |
348 return new NativeTabContentsViewWin(delegate); | 348 return new NativeTabContentsViewWin(delegate); |
349 } | 349 } |
OLD | NEW |