Chromium Code Reviews| 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/tab_contents/tab_contents.h" | 5 #include "chrome/browser/tab_contents/tab_contents.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 107 #include "grit/theme_resources.h" | 107 #include "grit/theme_resources.h" |
| 108 #include "net/base/mime_util.h" | 108 #include "net/base/mime_util.h" |
| 109 #include "net/base/net_errors.h" | 109 #include "net/base/net_errors.h" |
| 110 #include "net/base/net_util.h" | 110 #include "net/base/net_util.h" |
| 111 #include "net/base/registry_controlled_domain.h" | 111 #include "net/base/registry_controlled_domain.h" |
| 112 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" | 112 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" |
| 113 #include "webkit/glue/webpreferences.h" | 113 #include "webkit/glue/webpreferences.h" |
| 114 #include "webkit/glue/password_form.h" | 114 #include "webkit/glue/password_form.h" |
| 115 #include "webkit/glue/plugins/plugin_list.h" | 115 #include "webkit/glue/plugins/plugin_list.h" |
| 116 | 116 |
| 117 #if defined(TOUCH_UI) | |
| 118 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" | |
|
Ben Goodger (Google)
2010/12/10 15:42:57
Don't add this here - it's a layering violation.
| |
| 119 #endif | |
| 120 | |
| 117 // Cross-Site Navigations | 121 // Cross-Site Navigations |
| 118 // | 122 // |
| 119 // If a TabContents is told to navigate to a different web site (as determined | 123 // If a TabContents is told to navigate to a different web site (as determined |
| 120 // by SiteInstance), it will replace its current RenderViewHost with a new | 124 // by SiteInstance), it will replace its current RenderViewHost with a new |
| 121 // RenderViewHost dedicated to the new SiteInstance. This works as follows: | 125 // RenderViewHost dedicated to the new SiteInstance. This works as follows: |
| 122 // | 126 // |
| 123 // - Navigate determines whether the destination is cross-site, and if so, | 127 // - Navigate determines whether the destination is cross-site, and if so, |
| 124 // it creates a pending_render_view_host_ and moves into the PENDING | 128 // it creates a pending_render_view_host_ and moves into the PENDING |
| 125 // RendererState. | 129 // RendererState. |
| 126 // - The pending RVH is "suspended," so that no navigation messages are sent to | 130 // - The pending RVH is "suspended," so that no navigation messages are sent to |
| (...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1037 } | 1041 } |
| 1038 | 1042 |
| 1039 gfx::NativeView TabContents::GetContentNativeView() const { | 1043 gfx::NativeView TabContents::GetContentNativeView() const { |
| 1040 return view_->GetContentNativeView(); | 1044 return view_->GetContentNativeView(); |
| 1041 } | 1045 } |
| 1042 | 1046 |
| 1043 gfx::NativeView TabContents::GetNativeView() const { | 1047 gfx::NativeView TabContents::GetNativeView() const { |
| 1044 return view_->GetNativeView(); | 1048 return view_->GetNativeView(); |
| 1045 } | 1049 } |
| 1046 | 1050 |
| 1051 #if defined(TOUCH_UI) | |
| 1052 views::View* TabContents::GetViewsView() { | |
| 1053 return static_cast<TabContentsViewViews*>(view_.get()); | |
| 1054 } | |
| 1055 #endif | |
| 1056 | |
| 1047 void TabContents::GetContainerBounds(gfx::Rect *out) const { | 1057 void TabContents::GetContainerBounds(gfx::Rect *out) const { |
| 1048 view_->GetContainerBounds(out); | 1058 view_->GetContainerBounds(out); |
| 1049 } | 1059 } |
| 1050 | 1060 |
| 1051 void TabContents::Focus() { | 1061 void TabContents::Focus() { |
| 1052 view_->Focus(); | 1062 view_->Focus(); |
| 1053 } | 1063 } |
| 1054 | 1064 |
| 1055 void TabContents::FocusThroughTabTraversal(bool reverse) { | 1065 void TabContents::FocusThroughTabTraversal(bool reverse) { |
| 1056 if (showing_interstitial_page()) { | 1066 if (showing_interstitial_page()) { |
| (...skipping 2225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3282 } | 3292 } |
| 3283 | 3293 |
| 3284 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { | 3294 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { |
| 3285 render_manager_.SwapInRenderViewHost(rvh); | 3295 render_manager_.SwapInRenderViewHost(rvh); |
| 3286 } | 3296 } |
| 3287 | 3297 |
| 3288 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 3298 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 3289 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 3299 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
| 3290 rwh_view->SetSize(view()->GetContainerSize()); | 3300 rwh_view->SetSize(view()->GetContainerSize()); |
| 3291 } | 3301 } |
| OLD | NEW |