Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 10544175: Add an ability to call WebKit's WebFrame::loadData via NavigationController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 #include "content/renderer/v8_value_converter_impl.h" 96 #include "content/renderer/v8_value_converter_impl.h"
97 #include "content/renderer/web_intents_host.h" 97 #include "content/renderer/web_intents_host.h"
98 #include "content/renderer/web_ui_bindings.h" 98 #include "content/renderer/web_ui_bindings.h"
99 #include "content/renderer/webplugin_delegate_proxy.h" 99 #include "content/renderer/webplugin_delegate_proxy.h"
100 #include "content/renderer/websharedworker_proxy.h" 100 #include "content/renderer/websharedworker_proxy.h"
101 #include "media/base/filter_collection.h" 101 #include "media/base/filter_collection.h"
102 #include "media/base/media_switches.h" 102 #include "media/base/media_switches.h"
103 #include "media/base/message_loop_factory.h" 103 #include "media/base/message_loop_factory.h"
104 #include "media/filters/audio_renderer_impl.h" 104 #include "media/filters/audio_renderer_impl.h"
105 #include "media/filters/gpu_video_decoder.h" 105 #include "media/filters/gpu_video_decoder.h"
106 #include "net/base/data_url.h"
106 #include "net/base/escape.h" 107 #include "net/base/escape.h"
107 #include "net/base/net_errors.h" 108 #include "net/base/net_errors.h"
108 #include "net/http/http_util.h" 109 #include "net/http/http_util.h"
109 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec t.h" 110 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec t.h"
110 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMEvent.h" 111 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMEvent.h"
111 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMMessageEvent.h" 112 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMMessageEvent.h"
112 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" 113 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h"
113 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" 114 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
114 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" 115 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h"
115 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams. h" 116 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams. h"
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 // back/forward navigation event. 1049 // back/forward navigation event.
1049 if (is_reload) { 1050 if (is_reload) {
1050 bool ignore_cache = (params.navigation_type == 1051 bool ignore_cache = (params.navigation_type ==
1051 ViewMsg_Navigate_Type::RELOAD_IGNORING_CACHE); 1052 ViewMsg_Navigate_Type::RELOAD_IGNORING_CACHE);
1052 main_frame->reload(ignore_cache); 1053 main_frame->reload(ignore_cache);
1053 } else if (!params.state.empty()) { 1054 } else if (!params.state.empty()) {
1054 // We must know the page ID of the page we are navigating back to. 1055 // We must know the page ID of the page we are navigating back to.
1055 DCHECK_NE(params.page_id, -1); 1056 DCHECK_NE(params.page_id, -1);
1056 main_frame->loadHistoryItem( 1057 main_frame->loadHistoryItem(
1057 webkit_glue::HistoryItemFromString(params.state)); 1058 webkit_glue::HistoryItemFromString(params.state));
1059 } else if (!params.base_url.is_empty()) {
1060 // A loadData request with a specified base URL.
1061 std::string mime_type, charset, data;
1062 if (net::DataURL::Parse(params.url, &mime_type, &charset, &data)) {
1063 main_frame->loadData(
1064 WebData(data.c_str(), data.length()),
1065 WebString::fromUTF8(mime_type),
1066 WebString::fromUTF8(charset),
1067 params.base_url,
1068 params.history_url,
1069 false);
1070 }
1058 } else { 1071 } else {
1059 // Navigate to the given URL. 1072 // Navigate to the given URL.
1060 WebURLRequest request(params.url); 1073 WebURLRequest request(params.url);
1061 1074
1062 // A session history navigation should have been accompanied by state. 1075 // A session history navigation should have been accompanied by state.
1063 CHECK_EQ(params.page_id, -1); 1076 CHECK_EQ(params.page_id, -1);
1064 1077
1065 if (main_frame->isViewSourceModeEnabled()) 1078 if (main_frame->isViewSourceModeEnabled())
1066 request.setCachePolicy(WebURLRequest::ReturnCacheDataElseLoad); 1079 request.setCachePolicy(WebURLRequest::ReturnCacheDataElseLoad);
1067 1080
(...skipping 4590 matching lines...) Expand 10 before | Expand all | Expand 10 after
5658 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { 5671 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const {
5659 return !!RenderThreadImpl::current()->compositor_thread(); 5672 return !!RenderThreadImpl::current()->compositor_thread();
5660 } 5673 }
5661 5674
5662 void RenderViewImpl::OnJavaBridgeInit() { 5675 void RenderViewImpl::OnJavaBridgeInit() {
5663 DCHECK(!java_bridge_dispatcher_); 5676 DCHECK(!java_bridge_dispatcher_);
5664 #if defined(ENABLE_JAVA_BRIDGE) 5677 #if defined(ENABLE_JAVA_BRIDGE)
5665 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); 5678 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this);
5666 #endif 5679 #endif
5667 } 5680 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698