OLD | NEW |
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 Loading... |
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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 if (spellcheck_.get()) | 696 if (spellcheck_.get()) |
699 thread->RemoveObserver(spellcheck_.get()); | 697 thread->RemoveObserver(spellcheck_.get()); |
700 SpellCheck* new_spellcheck = new SpellCheck(); | 698 SpellCheck* new_spellcheck = new SpellCheck(); |
701 if (spellcheck_provider_) | 699 if (spellcheck_provider_) |
702 spellcheck_provider_->SetSpellCheck(new_spellcheck); | 700 spellcheck_provider_->SetSpellCheck(new_spellcheck); |
703 spellcheck_.reset(new_spellcheck); | 701 spellcheck_.reset(new_spellcheck); |
704 thread->AddObserver(new_spellcheck); | 702 thread->AddObserver(new_spellcheck); |
705 } | 703 } |
706 | 704 |
707 } // namespace chrome | 705 } // namespace chrome |
OLD | NEW |