| 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 if (spellcheck_.get()) | 769 if (spellcheck_.get()) |
| 772 thread->RemoveObserver(spellcheck_.get()); | 770 thread->RemoveObserver(spellcheck_.get()); |
| 773 SpellCheck* new_spellcheck = new SpellCheck(); | 771 SpellCheck* new_spellcheck = new SpellCheck(); |
| 774 if (spellcheck_provider_) | 772 if (spellcheck_provider_) |
| 775 spellcheck_provider_->SetSpellCheck(new_spellcheck); | 773 spellcheck_provider_->SetSpellCheck(new_spellcheck); |
| 776 spellcheck_.reset(new_spellcheck); | 774 spellcheck_.reset(new_spellcheck); |
| 777 thread->AddObserver(new_spellcheck); | 775 thread->AddObserver(new_spellcheck); |
| 778 } | 776 } |
| 779 | 777 |
| 780 } // namespace chrome | 778 } // namespace chrome |
| OLD | NEW |