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/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "app/l10n_util.h" | 11 #include "app/l10n_util.h" |
12 #include "app/message_box_flags.h" | 12 #include "app/message_box_flags.h" |
13 #include "app/resource_bundle.h" | 13 #include "app/resource_bundle.h" |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
17 #include "base/field_trial.h" | 17 #include "base/field_trial.h" |
18 #include "base/histogram.h" | 18 #include "base/histogram.h" |
19 #include "base/process_util.h" | 19 #include "base/process_util.h" |
20 #include "base/singleton.h" | 20 #include "base/singleton.h" |
21 #include "base/string_piece.h" | 21 #include "base/string_piece.h" |
22 #include "base/string_util.h" | 22 #include "base/string_util.h" |
23 #include "base/time.h" | 23 #include "base/time.h" |
24 #include "build/build_config.h" | 24 #include "build/build_config.h" |
| 25 #include "chrome/common/appcache/appcache_dispatcher.h" |
25 #include "chrome/common/bindings_policy.h" | 26 #include "chrome/common/bindings_policy.h" |
26 #include "chrome/common/child_process_logging.h" | 27 #include "chrome/common/child_process_logging.h" |
27 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
28 #include "chrome/common/chrome_constants.h" | 29 #include "chrome/common/chrome_constants.h" |
29 #include "chrome/common/extensions/extension_constants.h" | 30 #include "chrome/common/extensions/extension_constants.h" |
30 #include "chrome/common/jstemplate_builder.h" | 31 #include "chrome/common/jstemplate_builder.h" |
31 #include "chrome/common/page_zoom.h" | 32 #include "chrome/common/page_zoom.h" |
32 #include "chrome/common/render_messages.h" | 33 #include "chrome/common/render_messages.h" |
33 #include "chrome/common/renderer_preferences.h" | 34 #include "chrome/common/renderer_preferences.h" |
34 #include "chrome/common/thumbnail_score.h" | 35 #include "chrome/common/thumbnail_score.h" |
35 #include "chrome/common/url_constants.h" | 36 #include "chrome/common/url_constants.h" |
36 #include "chrome/renderer/about_handler.h" | 37 #include "chrome/renderer/about_handler.h" |
37 #include "chrome/renderer/audio_message_filter.h" | 38 #include "chrome/renderer/audio_message_filter.h" |
38 #include "chrome/renderer/devtools_agent.h" | 39 #include "chrome/renderer/devtools_agent.h" |
39 #include "chrome/renderer/devtools_client.h" | 40 #include "chrome/renderer/devtools_client.h" |
40 #include "chrome/renderer/extension_groups.h" | 41 #include "chrome/renderer/extension_groups.h" |
41 #include "chrome/renderer/extensions/event_bindings.h" | 42 #include "chrome/renderer/extensions/event_bindings.h" |
42 #include "chrome/renderer/extensions/extension_process_bindings.h" | 43 #include "chrome/renderer/extensions/extension_process_bindings.h" |
43 #include "chrome/renderer/extensions/renderer_extension_bindings.h" | 44 #include "chrome/renderer/extensions/renderer_extension_bindings.h" |
44 #include "chrome/renderer/geolocation_dispatcher.h" | 45 #include "chrome/renderer/geolocation_dispatcher.h" |
45 #include "chrome/renderer/localized_error.h" | 46 #include "chrome/renderer/localized_error.h" |
46 #include "chrome/renderer/media/audio_renderer_impl.h" | 47 #include "chrome/renderer/media/audio_renderer_impl.h" |
47 #include "chrome/renderer/media/ipc_video_renderer.h" | 48 #include "chrome/renderer/media/ipc_video_renderer.h" |
48 #include "chrome/renderer/navigation_state.h" | 49 #include "chrome/renderer/navigation_state.h" |
49 #include "chrome/renderer/notification_provider.h" | 50 #include "chrome/renderer/notification_provider.h" |
50 #include "chrome/renderer/plugin_channel_host.h" | 51 #include "chrome/renderer/plugin_channel_host.h" |
51 #include "chrome/renderer/print_web_view_helper.h" | 52 #include "chrome/renderer/print_web_view_helper.h" |
52 #include "chrome/renderer/render_process.h" | 53 #include "chrome/renderer/render_process.h" |
53 #include "chrome/renderer/render_thread.h" | 54 #include "chrome/renderer/render_thread.h" |
| 55 #include "chrome/renderer/renderer_webapplicationcachehost_impl.h" |
54 #include "chrome/renderer/renderer_webstoragenamespace_impl.h" | 56 #include "chrome/renderer/renderer_webstoragenamespace_impl.h" |
55 #include "chrome/renderer/spellchecker/spellcheck.h" | 57 #include "chrome/renderer/spellchecker/spellcheck.h" |
56 #include "chrome/renderer/user_script_slave.h" | 58 #include "chrome/renderer/user_script_slave.h" |
57 #include "chrome/renderer/visitedlink_slave.h" | 59 #include "chrome/renderer/visitedlink_slave.h" |
58 #include "chrome/renderer/webplugin_delegate_pepper.h" | 60 #include "chrome/renderer/webplugin_delegate_pepper.h" |
59 #include "chrome/renderer/webplugin_delegate_proxy.h" | 61 #include "chrome/renderer/webplugin_delegate_proxy.h" |
60 #include "chrome/renderer/websharedworker_proxy.h" | 62 #include "chrome/renderer/websharedworker_proxy.h" |
61 #include "chrome/renderer/webworker_proxy.h" | 63 #include "chrome/renderer/webworker_proxy.h" |
62 #include "gfx/color_utils.h" | 64 #include "gfx/color_utils.h" |
63 #include "gfx/favicon_size.h" | 65 #include "gfx/favicon_size.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 using base::Time; | 138 using base::Time; |
137 using base::TimeDelta; | 139 using base::TimeDelta; |
138 using webkit_glue::AltErrorPageResourceFetcher; | 140 using webkit_glue::AltErrorPageResourceFetcher; |
139 using webkit_glue::FormData; | 141 using webkit_glue::FormData; |
140 using webkit_glue::FormField; | 142 using webkit_glue::FormField; |
141 using webkit_glue::ImageResourceFetcher; | 143 using webkit_glue::ImageResourceFetcher; |
142 using webkit_glue::PasswordForm; | 144 using webkit_glue::PasswordForm; |
143 using webkit_glue::PasswordFormDomManager; | 145 using webkit_glue::PasswordFormDomManager; |
144 using WebKit::WebAccessibilityCache; | 146 using WebKit::WebAccessibilityCache; |
145 using WebKit::WebAccessibilityObject; | 147 using WebKit::WebAccessibilityObject; |
| 148 using WebKit::WebApplicationCacheHost; |
| 149 using WebKit::WebApplicationCacheHostClient; |
146 using WebKit::WebColor; | 150 using WebKit::WebColor; |
147 using WebKit::WebColorName; | 151 using WebKit::WebColorName; |
148 using WebKit::WebConsoleMessage; | 152 using WebKit::WebConsoleMessage; |
149 using WebKit::WebContextMenuData; | 153 using WebKit::WebContextMenuData; |
150 using WebKit::WebCookieJar; | 154 using WebKit::WebCookieJar; |
151 using WebKit::WebCString; | 155 using WebKit::WebCString; |
152 using WebKit::WebData; | 156 using WebKit::WebData; |
153 using WebKit::WebDataSource; | 157 using WebKit::WebDataSource; |
154 using WebKit::WebDevToolsAgent; | 158 using WebKit::WebDevToolsAgent; |
155 using WebKit::WebDocument; | 159 using WebKit::WebDocument; |
(...skipping 1982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2138 factory_factory = new IPCVideoRenderer::FactoryFactory(routing_id_); | 2142 factory_factory = new IPCVideoRenderer::FactoryFactory(routing_id_); |
2139 } else { | 2143 } else { |
2140 bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging); | 2144 bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging); |
2141 factory_factory = | 2145 factory_factory = |
2142 new webkit_glue::VideoRendererImpl::FactoryFactory(pts_logging); | 2146 new webkit_glue::VideoRendererImpl::FactoryFactory(pts_logging); |
2143 } | 2147 } |
2144 | 2148 |
2145 return new webkit_glue::WebMediaPlayerImpl(client, factory, factory_factory); | 2149 return new webkit_glue::WebMediaPlayerImpl(client, factory, factory_factory); |
2146 } | 2150 } |
2147 | 2151 |
| 2152 WebApplicationCacheHost* RenderView::createApplicationCacheHost( |
| 2153 WebFrame* frame, WebApplicationCacheHostClient* client) { |
| 2154 return new RendererWebApplicationCacheHostImpl( |
| 2155 FromWebView(frame->view()), client, |
| 2156 RenderThread::current()->appcache_dispatcher()->backend_proxy()); |
| 2157 } |
| 2158 |
2148 WebCookieJar* RenderView::cookieJar() { | 2159 WebCookieJar* RenderView::cookieJar() { |
2149 return &cookie_jar_; | 2160 return &cookie_jar_; |
2150 } | 2161 } |
2151 | 2162 |
2152 void RenderView::willClose(WebFrame* frame) { | 2163 void RenderView::willClose(WebFrame* frame) { |
2153 if (!frame->parent()) { | 2164 if (!frame->parent()) { |
2154 const GURL& url = frame->url(); | 2165 const GURL& url = frame->url(); |
2155 if (url.SchemeIs("http") || url.SchemeIs("https")) | 2166 if (url.SchemeIs("http") || url.SchemeIs("https")) |
2156 DumpLoadHistograms(); | 2167 DumpLoadHistograms(); |
2157 } | 2168 } |
(...skipping 2785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4943 | 4954 |
4944 if (last_top_level_navigation_page_id_ != page_id_ && | 4955 if (last_top_level_navigation_page_id_ != page_id_ && |
4945 // Not interested in reloads. | 4956 // Not interested in reloads. |
4946 type != WebKit::WebNavigationTypeReload && | 4957 type != WebKit::WebNavigationTypeReload && |
4947 type != WebKit::WebNavigationTypeFormSubmitted) { | 4958 type != WebKit::WebNavigationTypeFormSubmitted) { |
4948 return true; | 4959 return true; |
4949 } | 4960 } |
4950 } | 4961 } |
4951 return false; | 4962 return false; |
4952 } | 4963 } |
OLD | NEW |