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

Side by Side Diff: components/plugins/renderer/mobile_youtube_plugin.cc

Issue 2140523002: Remove WebURLRequest::initialize() and simplify WebURLRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mutable ref Created 4 years, 5 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
« no previous file with comments | « components/nacl/renderer/ppb_nacl_private_impl.cc ('k') | content/child/web_url_loader_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/plugins/renderer/mobile_youtube_plugin.h" 5 #include "components/plugins/renderer/mobile_youtube_plugin.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 return is_youtube && IsValidYouTubeVideo(url.path()) && 100 return is_youtube && IsValidYouTubeVideo(url.path()) &&
101 base::LowerCaseEqualsASCII(mime_type, 101 base::LowerCaseEqualsASCII(mime_type,
102 content::kFlashPluginSwfMimeType); 102 content::kFlashPluginSwfMimeType);
103 } 103 }
104 104
105 void MobileYouTubePlugin::OpenYoutubeUrlCallback() { 105 void MobileYouTubePlugin::OpenYoutubeUrlCallback() {
106 std::string youtube("vnd.youtube:"); 106 std::string youtube("vnd.youtube:");
107 GURL url(youtube.append(GetYoutubeVideoId(GetPluginParams()))); 107 GURL url(youtube.append(GetYoutubeVideoId(GetPluginParams())));
108 WebURLRequest request; 108 WebURLRequest request;
109 request.initialize();
110 request.setURL(url); 109 request.setURL(url);
111 render_frame()->LoadURLExternally(request, 110 render_frame()->LoadURLExternally(request,
112 blink::WebNavigationPolicyNewForegroundTab); 111 blink::WebNavigationPolicyNewForegroundTab);
113 } 112 }
114 113
115 v8::Local<v8::Value> MobileYouTubePlugin::GetV8Handle(v8::Isolate* isolate) { 114 v8::Local<v8::Value> MobileYouTubePlugin::GetV8Handle(v8::Isolate* isolate) {
116 return gin::CreateHandle(isolate, this).ToV8(); 115 return gin::CreateHandle(isolate, this).ToV8();
117 } 116 }
118 117
119 gin::ObjectTemplateBuilder MobileYouTubePlugin::GetObjectTemplateBuilder( 118 gin::ObjectTemplateBuilder MobileYouTubePlugin::GetObjectTemplateBuilder(
120 v8::Isolate* isolate) { 119 v8::Isolate* isolate) {
121 return gin::Wrappable<MobileYouTubePlugin>::GetObjectTemplateBuilder(isolate) 120 return gin::Wrappable<MobileYouTubePlugin>::GetObjectTemplateBuilder(isolate)
122 .SetMethod("openYoutubeURL", 121 .SetMethod("openYoutubeURL",
123 &MobileYouTubePlugin::OpenYoutubeUrlCallback); 122 &MobileYouTubePlugin::OpenYoutubeUrlCallback);
124 } 123 }
125 124
126 } // namespace plugins 125 } // namespace plugins
OLDNEW
« no previous file with comments | « components/nacl/renderer/ppb_nacl_private_impl.cc ('k') | content/child/web_url_loader_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698