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

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: add resource_context Created 9 years, 4 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 webkit::npapi::WebPluginInfo info; 285 webkit::npapi::WebPluginInfo info;
286 GURL url(original_params.url); 286 GURL url(original_params.url);
287 std::string orig_mime_type = original_params.mimeType.utf8(); 287 std::string orig_mime_type = original_params.mimeType.utf8();
288 std::string actual_mime_type; 288 std::string actual_mime_type;
289 render_view->Send(new ViewHostMsg_GetPluginInfo( 289 render_view->Send(new ViewHostMsg_GetPluginInfo(
290 render_view->routing_id(), url, frame->top()->document().url(), 290 render_view->routing_id(), url, frame->top()->document().url(),
291 orig_mime_type, &found, &info, &actual_mime_type)); 291 orig_mime_type, &found, &info, &actual_mime_type));
292 292
293 if (!found) 293 if (!found)
294 return NULL; 294 return NULL;
295 if (!webkit::npapi::IsPluginEnabled(info))
296 return NULL;
297 295
298 *is_default_plugin = 296 *is_default_plugin =
299 info.path.value() == webkit::npapi::kDefaultPluginLibraryName; 297 info.path.value() == webkit::npapi::kDefaultPluginLibraryName;
300 298
301 if (orig_mime_type == actual_mime_type) { 299 if (orig_mime_type == actual_mime_type) {
302 UMA_HISTOGRAM_ENUMERATION(kPluginTypeMismatch, 300 UMA_HISTOGRAM_ENUMERATION(kPluginTypeMismatch,
303 PLUGIN_TYPE_MISMATCH_NONE, 301 PLUGIN_TYPE_MISMATCH_NONE,
304 PLUGIN_TYPE_MISMATCH_NUM_EVENTS); 302 PLUGIN_TYPE_MISMATCH_NUM_EVENTS);
305 } else if (orig_mime_type.empty()) { 303 } else if (orig_mime_type.empty()) {
306 UMA_HISTOGRAM_ENUMERATION(kPluginTypeMismatch, 304 UMA_HISTOGRAM_ENUMERATION(kPluginTypeMismatch,
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 if (old_url == new_url) { 684 if (old_url == new_url) {
687 bool is_extension_url = !!extensions->GetByURL(new_url); 685 bool is_extension_url = !!extensions->GetByURL(new_url);
688 if (is_extension_url != extension_dispatcher_->is_extension_process()) 686 if (is_extension_url != extension_dispatcher_->is_extension_process())
689 return true; 687 return true;
690 } 688 }
691 689
692 return !extensions->InSameExtent(old_url, new_url); 690 return !extensions->InSameExtent(old_url, new_url);
693 } 691 }
694 692
695 } // namespace chrome 693 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698