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

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 598453004: Replace some hard coded schemes with the constants in /url/url_constants.h. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address the comment. Created 6 years, 2 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
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/pepper/pepper_plugin_instance_impl.h" 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 3195 matching lines...) Expand 10 before | Expand all | Expand 10 after
3206 3206
3207 WebURLRequest web_request; 3207 WebURLRequest web_request;
3208 if (!CreateWebURLRequest( 3208 if (!CreateWebURLRequest(
3209 pp_instance_, &completed_request, frame, &web_request)) { 3209 pp_instance_, &completed_request, frame, &web_request)) {
3210 return PP_ERROR_FAILED; 3210 return PP_ERROR_FAILED;
3211 } 3211 }
3212 web_request.setFirstPartyForCookies(document.firstPartyForCookies()); 3212 web_request.setFirstPartyForCookies(document.firstPartyForCookies());
3213 web_request.setHasUserGesture(from_user_action); 3213 web_request.setHasUserGesture(from_user_action);
3214 3214
3215 GURL gurl(web_request.url()); 3215 GURL gurl(web_request.url());
3216 if (gurl.SchemeIs("javascript")) { 3216 if (gurl.SchemeIs(url::kJavaScriptScheme)) {
3217 // In imitation of the NPAPI implementation, only |target_frame == frame| is 3217 // In imitation of the NPAPI implementation, only |target_frame == frame| is
3218 // allowed for security reasons. 3218 // allowed for security reasons.
3219 WebFrame* target_frame = 3219 WebFrame* target_frame =
3220 frame->view()->findFrameByName(WebString::fromUTF8(target), frame); 3220 frame->view()->findFrameByName(WebString::fromUTF8(target), frame);
3221 if (target_frame != frame) 3221 if (target_frame != frame)
3222 return PP_ERROR_NOACCESS; 3222 return PP_ERROR_NOACCESS;
3223 3223
3224 // TODO(viettrungluu): NPAPI sends the result back to the plugin -- do we 3224 // TODO(viettrungluu): NPAPI sends the result back to the plugin -- do we
3225 // need that? 3225 // need that?
3226 WebString result = container_->executeScriptURL(gurl, from_user_action); 3226 WebString result = container_->executeScriptURL(gurl, from_user_action);
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
3377 // Running out-of-process. Initiate an IPC call to notify the plugin 3377 // Running out-of-process. Initiate an IPC call to notify the plugin
3378 // process. 3378 // process.
3379 ppapi::proxy::HostDispatcher* dispatcher = 3379 ppapi::proxy::HostDispatcher* dispatcher =
3380 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); 3380 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance());
3381 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( 3381 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad(
3382 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); 3382 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data));
3383 } 3383 }
3384 } 3384 }
3385 3385
3386 } // namespace content 3386 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/npapi/webplugin_impl.cc ('k') | content/renderer/pepper/url_request_info_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698