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

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

Issue 7387010: Add PluginServiceFilter interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unit test 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
« no previous file with comments | « chrome/common/chrome_notification_types.h ('k') | content/browser/plugin_process_host.h » ('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 (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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 webkit::WebPluginInfo info; 291 webkit::WebPluginInfo info;
292 GURL url(original_params.url); 292 GURL url(original_params.url);
293 std::string orig_mime_type = original_params.mimeType.utf8(); 293 std::string orig_mime_type = original_params.mimeType.utf8();
294 std::string actual_mime_type; 294 std::string actual_mime_type;
295 render_view->Send(new ViewHostMsg_GetPluginInfo( 295 render_view->Send(new ViewHostMsg_GetPluginInfo(
296 render_view->routing_id(), url, frame->top()->document().url(), 296 render_view->routing_id(), url, frame->top()->document().url(),
297 orig_mime_type, &found, &info, &actual_mime_type)); 297 orig_mime_type, &found, &info, &actual_mime_type));
298 298
299 if (!found) 299 if (!found)
300 return NULL; 300 return NULL;
301 if (!webkit::IsPluginEnabled(info))
302 return NULL;
303 301
304 *is_default_plugin = 302 *is_default_plugin =
305 info.path.value() == webkit::npapi::kDefaultPluginLibraryName; 303 info.path.value() == webkit::npapi::kDefaultPluginLibraryName;
306 304
307 if (orig_mime_type == actual_mime_type) { 305 if (orig_mime_type == actual_mime_type) {
308 UMA_HISTOGRAM_ENUMERATION(kPluginTypeMismatch, 306 UMA_HISTOGRAM_ENUMERATION(kPluginTypeMismatch,
309 PLUGIN_TYPE_MISMATCH_NONE, 307 PLUGIN_TYPE_MISMATCH_NONE,
310 PLUGIN_TYPE_MISMATCH_NUM_EVENTS); 308 PLUGIN_TYPE_MISMATCH_NUM_EVENTS);
311 } else if (orig_mime_type.empty()) { 309 } else if (orig_mime_type.empty()) {
312 UMA_HISTOGRAM_ENUMERATION(kPluginTypeMismatch, 310 UMA_HISTOGRAM_ENUMERATION(kPluginTypeMismatch,
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 if (spellcheck_.get()) 766 if (spellcheck_.get())
769 thread->RemoveObserver(spellcheck_.get()); 767 thread->RemoveObserver(spellcheck_.get());
770 SpellCheck* new_spellcheck = new SpellCheck(); 768 SpellCheck* new_spellcheck = new SpellCheck();
771 if (spellcheck_provider_) 769 if (spellcheck_provider_)
772 spellcheck_provider_->SetSpellCheck(new_spellcheck); 770 spellcheck_provider_->SetSpellCheck(new_spellcheck);
773 spellcheck_.reset(new_spellcheck); 771 spellcheck_.reset(new_spellcheck);
774 thread->AddObserver(new_spellcheck); 772 thread->AddObserver(new_spellcheck);
775 } 773 }
776 774
777 } // namespace chrome 775 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/common/chrome_notification_types.h ('k') | content/browser/plugin_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698