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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 #include "grit/locale_settings.h" | 106 #include "grit/locale_settings.h" |
107 #include "grit/platform_locale_settings.h" | 107 #include "grit/platform_locale_settings.h" |
108 #include "grit/theme_resources.h" | 108 #include "grit/theme_resources.h" |
109 #include "net/base/mime_util.h" | 109 #include "net/base/mime_util.h" |
110 #include "net/base/net_errors.h" | 110 #include "net/base/net_errors.h" |
111 #include "net/base/net_util.h" | 111 #include "net/base/net_util.h" |
112 #include "net/base/registry_controlled_domain.h" | 112 #include "net/base/registry_controlled_domain.h" |
113 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" | 113 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" |
114 #include "webkit/glue/webpreferences.h" | 114 #include "webkit/glue/webpreferences.h" |
115 #include "webkit/glue/password_form.h" | 115 #include "webkit/glue/password_form.h" |
116 #include "webkit/plugins/npapi/plugin_list.h" | 116 #include "webkit/glue/plugins/plugin_list.h" |
117 | 117 |
118 // Cross-Site Navigations | 118 // Cross-Site Navigations |
119 // | 119 // |
120 // If a TabContents is told to navigate to a different web site (as determined | 120 // If a TabContents is told to navigate to a different web site (as determined |
121 // by SiteInstance), it will replace its current RenderViewHost with a new | 121 // by SiteInstance), it will replace its current RenderViewHost with a new |
122 // RenderViewHost dedicated to the new SiteInstance. This works as follows: | 122 // RenderViewHost dedicated to the new SiteInstance. This works as follows: |
123 // | 123 // |
124 // - Navigate determines whether the destination is cross-site, and if so, | 124 // - Navigate determines whether the destination is cross-site, and if so, |
125 // it creates a pending_render_view_host_ and moves into the PENDING | 125 // it creates a pending_render_view_host_ and moves into the PENDING |
126 // RendererState. | 126 // RendererState. |
(...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2084 #if defined(OS_WIN) | 2084 #if defined(OS_WIN) |
2085 // TODO(PORT): pull in when plug-ins work | 2085 // TODO(PORT): pull in when plug-ins work |
2086 GetPluginInstaller()->OnMissingPluginStatus(status); | 2086 GetPluginInstaller()->OnMissingPluginStatus(status); |
2087 #endif | 2087 #endif |
2088 } | 2088 } |
2089 | 2089 |
2090 void TabContents::OnCrashedPlugin(const FilePath& plugin_path) { | 2090 void TabContents::OnCrashedPlugin(const FilePath& plugin_path) { |
2091 DCHECK(!plugin_path.value().empty()); | 2091 DCHECK(!plugin_path.value().empty()); |
2092 | 2092 |
2093 std::wstring plugin_name = plugin_path.ToWStringHack(); | 2093 std::wstring plugin_name = plugin_path.ToWStringHack(); |
2094 webkit::npapi::WebPluginInfo plugin_info; | 2094 WebPluginInfo plugin_info; |
2095 if (webkit::npapi::PluginList::Singleton()->GetPluginInfoByPath( | 2095 if (NPAPI::PluginList::Singleton()->GetPluginInfoByPath( |
2096 plugin_path, &plugin_info) && | 2096 plugin_path, &plugin_info) && |
2097 !plugin_info.name.empty()) { | 2097 !plugin_info.name.empty()) { |
2098 plugin_name = UTF16ToWide(plugin_info.name); | 2098 plugin_name = UTF16ToWide(plugin_info.name); |
2099 #if defined(OS_MACOSX) | 2099 #if defined(OS_MACOSX) |
2100 // Many plugins on the Mac have .plugin in the actual name, which looks | 2100 // Many plugins on the Mac have .plugin in the actual name, which looks |
2101 // terrible, so look for that and strip it off if present. | 2101 // terrible, so look for that and strip it off if present. |
2102 const std::wstring plugin_extension(L".plugin"); | 2102 const std::wstring plugin_extension(L".plugin"); |
2103 if (EndsWith(plugin_name, plugin_extension, true)) | 2103 if (EndsWith(plugin_name, plugin_extension, true)) |
2104 plugin_name.erase(plugin_name.length() - plugin_extension.length()); | 2104 plugin_name.erase(plugin_name.length() - plugin_extension.length()); |
2105 #endif // OS_MACOSX | 2105 #endif // OS_MACOSX |
(...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3346 } | 3346 } |
3347 | 3347 |
3348 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { | 3348 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { |
3349 render_manager_.SwapInRenderViewHost(rvh); | 3349 render_manager_.SwapInRenderViewHost(rvh); |
3350 } | 3350 } |
3351 | 3351 |
3352 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 3352 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
3353 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 3353 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
3354 rwh_view->SetSize(view()->GetContainerSize()); | 3354 rwh_view->SetSize(view()->GetContainerSize()); |
3355 } | 3355 } |
OLD | NEW |