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

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 7972018: Don't depend on the embedder creating a plugin. That way embedders can always provide an empty Co... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/renderer/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 } 258 }
259 259
260 SkBitmap* ChromeContentRendererClient::GetSadPluginBitmap() { 260 SkBitmap* ChromeContentRendererClient::GetSadPluginBitmap() {
261 return ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_SAD_PLUGIN); 261 return ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_SAD_PLUGIN);
262 } 262 }
263 263
264 std::string ChromeContentRendererClient::GetDefaultEncoding() { 264 std::string ChromeContentRendererClient::GetDefaultEncoding() {
265 return l10n_util::GetStringUTF8(IDS_DEFAULT_ENCODING); 265 return l10n_util::GetStringUTF8(IDS_DEFAULT_ENCODING);
266 } 266 }
267 267
268 bool ChromeContentRendererClient::OverrideCreatePlugin(
269 RenderView* render_view,
270 WebFrame* frame,
271 const WebPluginParams& params,
272 WebKit::WebPlugin** plugin) {
273 bool is_default_plugin;
274 *plugin = CreatePlugin(render_view, frame, params, &is_default_plugin);
275 if (!*plugin || is_default_plugin)
276 MissingPluginReporter::GetInstance()->ReportPluginMissing(
277 params.mimeType.utf8(), params.url);
278 return true;
279 }
280
268 WebPlugin* ChromeContentRendererClient::CreatePlugin( 281 WebPlugin* ChromeContentRendererClient::CreatePlugin(
269 RenderView* render_view, 282 RenderView* render_view,
270 WebFrame* frame, 283 WebFrame* frame,
271 const WebPluginParams& original_params) {
272 bool is_default_plugin;
273 WebPlugin* plugin = CreatePluginImpl(render_view,
274 frame,
275 original_params,
276 &is_default_plugin);
277 if (!plugin || is_default_plugin)
278 MissingPluginReporter::GetInstance()->ReportPluginMissing(
279 original_params.mimeType.utf8(),
280 original_params.url);
281 return plugin;
282 }
283
284 WebPlugin* ChromeContentRendererClient::CreatePluginImpl(
285 RenderView* render_view,
286 WebFrame* frame,
287 const WebPluginParams& original_params, 284 const WebPluginParams& original_params,
288 bool* is_default_plugin) { 285 bool* is_default_plugin) {
289 *is_default_plugin = false; 286 *is_default_plugin = false;
290 CommandLine* cmd = CommandLine::ForCurrentProcess(); 287 CommandLine* cmd = CommandLine::ForCurrentProcess();
291 webkit::WebPluginInfo info; 288 webkit::WebPluginInfo info;
292 GURL url(original_params.url); 289 GURL url(original_params.url);
293 std::string orig_mime_type = original_params.mimeType.utf8(); 290 std::string orig_mime_type = original_params.mimeType.utf8();
294 std::string actual_mime_type; 291 std::string actual_mime_type;
295 292
296 bool found = render_view->GetPluginInfo( 293 bool found = render_view->GetPluginInfo(
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 if (spellcheck_.get()) 758 if (spellcheck_.get())
762 thread->RemoveObserver(spellcheck_.get()); 759 thread->RemoveObserver(spellcheck_.get());
763 SpellCheck* new_spellcheck = new SpellCheck(); 760 SpellCheck* new_spellcheck = new SpellCheck();
764 if (spellcheck_provider_) 761 if (spellcheck_provider_)
765 spellcheck_provider_->SetSpellCheck(new_spellcheck); 762 spellcheck_provider_->SetSpellCheck(new_spellcheck);
766 spellcheck_.reset(new_spellcheck); 763 spellcheck_.reset(new_spellcheck);
767 thread->AddObserver(new_spellcheck); 764 thread->AddObserver(new_spellcheck);
768 } 765 }
769 766
770 } // namespace chrome 767 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.h ('k') | content/renderer/content_renderer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698