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

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: Updated comments 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 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 // back/forward navigation event. 1048 // back/forward navigation event.
1048 if (is_reload) { 1049 if (is_reload) {
1049 bool ignore_cache = (params.navigation_type == 1050 bool ignore_cache = (params.navigation_type ==
1050 ViewMsg_Navigate_Type::RELOAD_IGNORING_CACHE); 1051 ViewMsg_Navigate_Type::RELOAD_IGNORING_CACHE);
1051 main_frame->reload(ignore_cache); 1052 main_frame->reload(ignore_cache);
1052 } else if (!params.state.empty()) { 1053 } else if (!params.state.empty()) {
1053 // We must know the page ID of the page we are navigating back to. 1054 // We must know the page ID of the page we are navigating back to.
1054 DCHECK_NE(params.page_id, -1); 1055 DCHECK_NE(params.page_id, -1);
1055 main_frame->loadHistoryItem( 1056 main_frame->loadHistoryItem(
1056 webkit_glue::HistoryItemFromString(params.state)); 1057 webkit_glue::HistoryItemFromString(params.state));
1058 } else if (!params.base_url.is_empty()) {
1059 // A loadData request with a specified base URL.
1060 std::string mime_type, charset, data;
1061 if (net::DataURL::Parse(params.url, &mime_type, &charset, &data)) {
1062 main_frame->loadData(
1063 WebData(data.c_str(), data.length()),
1064 WebString::fromUTF8(mime_type),
1065 WebString::fromUTF8(charset),
1066 params.base_url,
1067 params.history_url,
1068 false);
1069 }
1057 } else { 1070 } else {
1058 // Navigate to the given URL. 1071 // Navigate to the given URL.
1059 WebURLRequest request(params.url); 1072 WebURLRequest request(params.url);
1060 1073
1061 // A session history navigation should have been accompanied by state. 1074 // A session history navigation should have been accompanied by state.
1062 CHECK_EQ(params.page_id, -1); 1075 CHECK_EQ(params.page_id, -1);
1063 1076
1064 if (main_frame->isViewSourceModeEnabled()) 1077 if (main_frame->isViewSourceModeEnabled())
1065 request.setCachePolicy(WebURLRequest::ReturnCacheDataElseLoad); 1078 request.setCachePolicy(WebURLRequest::ReturnCacheDataElseLoad);
1066 1079
(...skipping 4591 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
« content/public/browser/navigation_entry.h ('K') | « content/public/browser/navigation_entry.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698