| 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/tab_contents/tab_contents.h" | 5 #include "content/browser/tab_contents/tab_contents.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 #include "content/public/common/url_constants.h" | 59 #include "content/public/common/url_constants.h" |
| 60 #include "net/base/mime_util.h" | 60 #include "net/base/mime_util.h" |
| 61 #include "net/base/net_util.h" | 61 #include "net/base/net_util.h" |
| 62 #include "net/base/network_change_notifier.h" | 62 #include "net/base/network_change_notifier.h" |
| 63 #include "net/url_request/url_request_context_getter.h" | 63 #include "net/url_request/url_request_context_getter.h" |
| 64 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 64 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 65 #include "webkit/glue/web_intent_data.h" | 65 #include "webkit/glue/web_intent_data.h" |
| 66 #include "webkit/glue/webpreferences.h" | 66 #include "webkit/glue/webpreferences.h" |
| 67 | 67 |
| 68 #if defined(USE_AURA) | 68 #if defined(USE_AURA) |
| 69 #include "content/browser/tab_contents/tab_contents_view_aura.h" | 69 #include "content/browser/web_contents/web_contents_view_aura.h" |
| 70 #elif defined(OS_WIN) | 70 #elif defined(OS_WIN) |
| 71 #include "content/browser/tab_contents/tab_contents_view_win.h" | 71 #include "content/browser/web_contents/web_contents_view_win.h" |
| 72 #elif defined(TOOLKIT_GTK) | 72 #elif defined(TOOLKIT_GTK) |
| 73 #include "content/browser/tab_contents/tab_contents_view_gtk.h" | 73 #include "content/browser/web_contents/web_contents_view_gtk.h" |
| 74 #elif defined(OS_MACOSX) | 74 #elif defined(OS_MACOSX) |
| 75 #include "content/browser/web_contents/web_contents_view_mac.h" | 75 #include "content/browser/web_contents/web_contents_view_mac.h" |
| 76 #include "ui/gfx/surface/io_surface_support_mac.h" | 76 #include "ui/gfx/surface/io_surface_support_mac.h" |
| 77 #elif defined(OS_ANDROID) | 77 #elif defined(OS_ANDROID) |
| 78 #include "content/browser/web_contents/web_contents_view_android.h" | 78 #include "content/browser/web_contents/web_contents_view_android.h" |
| 79 #endif | 79 #endif |
| 80 | 80 |
| 81 // Cross-Site Navigations | 81 // Cross-Site Navigations |
| 82 // | 82 // |
| 83 // If a WebContentsImpl is told to navigate to a different web site (as | 83 // If a WebContentsImpl is told to navigate to a different web site (as |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 color_chooser_(NULL) { | 280 color_chooser_(NULL) { |
| 281 render_manager_.Init(browser_context, site_instance, routing_id); | 281 render_manager_.Init(browser_context, site_instance, routing_id); |
| 282 | 282 |
| 283 view_.reset(content::GetContentClient()->browser()-> | 283 view_.reset(content::GetContentClient()->browser()-> |
| 284 OverrideCreateWebContentsView(this)); | 284 OverrideCreateWebContentsView(this)); |
| 285 if (!view_.get()) { | 285 if (!view_.get()) { |
| 286 content::WebContentsViewDelegate* delegate = | 286 content::WebContentsViewDelegate* delegate = |
| 287 content::GetContentClient()->browser()->GetWebContentsViewDelegate( | 287 content::GetContentClient()->browser()->GetWebContentsViewDelegate( |
| 288 this); | 288 this); |
| 289 #if defined(USE_AURA) | 289 #if defined(USE_AURA) |
| 290 view_.reset(new TabContentsViewAura(this, delegate)); | 290 view_.reset(new WebContentsViewAura(this, delegate)); |
| 291 #elif defined(OS_WIN) | 291 #elif defined(OS_WIN) |
| 292 view_.reset(new TabContentsViewWin(this, delegate)); | 292 view_.reset(new WebContentsViewWin(this, delegate)); |
| 293 #elif defined(TOOLKIT_GTK) | 293 #elif defined(TOOLKIT_GTK) |
| 294 view_.reset(new content::TabContentsViewGtk(this, delegate)); | 294 view_.reset(new content::WebContentsViewGtk(this, delegate)); |
| 295 #elif defined(OS_MACOSX) | 295 #elif defined(OS_MACOSX) |
| 296 view_.reset(web_contents_view_mac::CreateWebContentsView(this, delegate)); | 296 view_.reset(web_contents_view_mac::CreateWebContentsView(this, delegate)); |
| 297 #elif defined(OS_ANDROID) | 297 #elif defined(OS_ANDROID) |
| 298 view_.reset(new WebContentsViewAndroid(this)); | 298 view_.reset(new WebContentsViewAndroid(this)); |
| 299 #endif | 299 #endif |
| 300 (void)delegate; | 300 (void)delegate; |
| 301 } | 301 } |
| 302 CHECK(view_.get()); | 302 CHECK(view_.get()); |
| 303 | 303 |
| 304 // We have the initial size of the view be based on the size of the passed in | 304 // We have the initial size of the view be based on the size of the passed in |
| (...skipping 2310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2615 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2615 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 2616 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 2616 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
| 2617 // Can be NULL during tests. | 2617 // Can be NULL during tests. |
| 2618 if (rwh_view) | 2618 if (rwh_view) |
| 2619 rwh_view->SetSize(GetView()->GetContainerSize()); | 2619 rwh_view->SetSize(GetView()->GetContainerSize()); |
| 2620 } | 2620 } |
| 2621 | 2621 |
| 2622 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { | 2622 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { |
| 2623 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); | 2623 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); |
| 2624 } | 2624 } |
| OLD | NEW |