| 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/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 #include "content/renderer/v8_value_converter_impl.h" | 94 #include "content/renderer/v8_value_converter_impl.h" |
| 95 #include "content/renderer/web_intents_host.h" | 95 #include "content/renderer/web_intents_host.h" |
| 96 #include "content/renderer/web_ui_bindings.h" | 96 #include "content/renderer/web_ui_bindings.h" |
| 97 #include "content/renderer/webplugin_delegate_proxy.h" | 97 #include "content/renderer/webplugin_delegate_proxy.h" |
| 98 #include "content/renderer/websharedworker_proxy.h" | 98 #include "content/renderer/websharedworker_proxy.h" |
| 99 #include "media/base/filter_collection.h" | 99 #include "media/base/filter_collection.h" |
| 100 #include "media/base/media_switches.h" | 100 #include "media/base/media_switches.h" |
| 101 #include "media/base/message_loop_factory.h" | 101 #include "media/base/message_loop_factory.h" |
| 102 #include "media/filters/audio_renderer_impl.h" | 102 #include "media/filters/audio_renderer_impl.h" |
| 103 #include "media/filters/gpu_video_decoder.h" | 103 #include "media/filters/gpu_video_decoder.h" |
| 104 #include "net/base/data_url.h" |
| 104 #include "net/base/escape.h" | 105 #include "net/base/escape.h" |
| 105 #include "net/base/net_errors.h" | 106 #include "net/base/net_errors.h" |
| 106 #include "net/http/http_util.h" | 107 #include "net/http/http_util.h" |
| 107 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec
t.h" | 108 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec
t.h" |
| 108 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMEvent.h" | 109 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMEvent.h" |
| 109 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMMessageEvent.h" | 110 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMMessageEvent.h" |
| 110 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" | 111 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" |
| 111 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 112 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
| 112 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" | 113 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
| 113 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams.
h" | 114 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams.
h" |
| (...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1046 // back/forward navigation event. | 1047 // back/forward navigation event. |
| 1047 if (is_reload) { | 1048 if (is_reload) { |
| 1048 bool ignore_cache = (params.navigation_type == | 1049 bool ignore_cache = (params.navigation_type == |
| 1049 ViewMsg_Navigate_Type::RELOAD_IGNORING_CACHE); | 1050 ViewMsg_Navigate_Type::RELOAD_IGNORING_CACHE); |
| 1050 main_frame->reload(ignore_cache); | 1051 main_frame->reload(ignore_cache); |
| 1051 } else if (!params.state.empty()) { | 1052 } else if (!params.state.empty()) { |
| 1052 // We must know the page ID of the page we are navigating back to. | 1053 // We must know the page ID of the page we are navigating back to. |
| 1053 DCHECK_NE(params.page_id, -1); | 1054 DCHECK_NE(params.page_id, -1); |
| 1054 main_frame->loadHistoryItem( | 1055 main_frame->loadHistoryItem( |
| 1055 webkit_glue::HistoryItemFromString(params.state)); | 1056 webkit_glue::HistoryItemFromString(params.state)); |
| 1057 } else if (!params.base_url_for_data_url.is_empty()) { |
| 1058 // A loadData request with a specified base URL. |
| 1059 std::string mime_type, charset, data; |
| 1060 if (net::DataURL::Parse(params.url, &mime_type, &charset, &data)) { |
| 1061 main_frame->loadData( |
| 1062 WebData(data.c_str(), data.length()), |
| 1063 WebString::fromUTF8(mime_type), |
| 1064 WebString::fromUTF8(charset), |
| 1065 params.base_url_for_data_url, |
| 1066 params.history_url_for_data_url, |
| 1067 false); |
| 1068 } else { |
| 1069 CHECK(false) << |
| 1070 "Invalid URL passed: " << params.url.possibly_invalid_spec(); |
| 1071 } |
| 1056 } else { | 1072 } else { |
| 1057 // Navigate to the given URL. | 1073 // Navigate to the given URL. |
| 1058 WebURLRequest request(params.url); | 1074 WebURLRequest request(params.url); |
| 1059 | 1075 |
| 1060 // A session history navigation should have been accompanied by state. | 1076 // A session history navigation should have been accompanied by state. |
| 1061 CHECK_EQ(params.page_id, -1); | 1077 CHECK_EQ(params.page_id, -1); |
| 1062 | 1078 |
| 1063 if (main_frame->isViewSourceModeEnabled()) | 1079 if (main_frame->isViewSourceModeEnabled()) |
| 1064 request.setCachePolicy(WebURLRequest::ReturnCacheDataElseLoad); | 1080 request.setCachePolicy(WebURLRequest::ReturnCacheDataElseLoad); |
| 1065 | 1081 |
| (...skipping 4639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5705 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5721 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
| 5706 return !!RenderThreadImpl::current()->compositor_thread(); | 5722 return !!RenderThreadImpl::current()->compositor_thread(); |
| 5707 } | 5723 } |
| 5708 | 5724 |
| 5709 void RenderViewImpl::OnJavaBridgeInit() { | 5725 void RenderViewImpl::OnJavaBridgeInit() { |
| 5710 DCHECK(!java_bridge_dispatcher_); | 5726 DCHECK(!java_bridge_dispatcher_); |
| 5711 #if defined(ENABLE_JAVA_BRIDGE) | 5727 #if defined(ENABLE_JAVA_BRIDGE) |
| 5712 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); | 5728 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); |
| 5713 #endif | 5729 #endif |
| 5714 } | 5730 } |
| OLD | NEW |