OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/web_contents/web_contents_view_gtk.h" | 5 #include "content/browser/web_contents/web_contents_view_gtk.h" |
6 | 6 |
7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 141 |
142 // Renderer target DnD. | 142 // Renderer target DnD. |
143 drag_dest_.reset(new WebDragDestGtk(web_contents_, content_view)); | 143 drag_dest_.reset(new WebDragDestGtk(web_contents_, content_view)); |
144 | 144 |
145 if (delegate_.get()) | 145 if (delegate_.get()) |
146 drag_dest_->set_delegate(delegate_->GetDragDestDelegate()); | 146 drag_dest_->set_delegate(delegate_->GetDragDestDelegate()); |
147 | 147 |
148 return view; | 148 return view; |
149 } | 149 } |
150 | 150 |
| 151 void WebContentsViewGtk::SetView(RenderWidgetHostView* view) { |
| 152 gfx::NativeView content_view = view->GetNativeView(); |
| 153 drag_dest_.reset(new WebDragDestGtk(web_contents_, content_view)); |
| 154 if (delegate_.get()) |
| 155 drag_dest_->set_delegate(delegate_->GetDragDestDelegate()); |
| 156 } |
| 157 |
151 gfx::NativeView WebContentsViewGtk::GetNativeView() const { | 158 gfx::NativeView WebContentsViewGtk::GetNativeView() const { |
152 if (delegate_.get()) | 159 if (delegate_.get()) |
153 return delegate_->GetNativeView(); | 160 return delegate_->GetNativeView(); |
154 | 161 |
155 return expanded_.get(); | 162 return expanded_.get(); |
156 } | 163 } |
157 | 164 |
158 gfx::NativeView WebContentsViewGtk::GetContentNativeView() const { | 165 gfx::NativeView WebContentsViewGtk::GetContentNativeView() const { |
159 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); | 166 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); |
160 if (!rwhv) | 167 if (!rwhv) |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 // We manually tell our RWHV to resize the renderer content. This avoids | 386 // We manually tell our RWHV to resize the renderer content. This avoids |
380 // spurious resizes from GTK+. | 387 // spurious resizes from GTK+. |
381 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); | 388 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); |
382 if (rwhv) | 389 if (rwhv) |
383 rwhv->SetSize(size); | 390 rwhv->SetSize(size); |
384 if (web_contents_->GetInterstitialPage()) | 391 if (web_contents_->GetInterstitialPage()) |
385 web_contents_->GetInterstitialPage()->SetSize(size); | 392 web_contents_->GetInterstitialPage()->SetSize(size); |
386 } | 393 } |
387 | 394 |
388 } // namespace content | 395 } // namespace content |
OLD | NEW |