OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/plugins/plugin_finder.h" | 5 #include "chrome/browser/plugins/plugin_finder.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 } // namespace | 154 } // namespace |
155 | 155 |
156 // static | 156 // static |
157 void PluginFinder::RegisterPrefs(PrefRegistrySimple* registry) { | 157 void PluginFinder::RegisterPrefs(PrefRegistrySimple* registry) { |
158 registry->RegisterBooleanPref(prefs::kDisablePluginFinder, false); | 158 registry->RegisterBooleanPref(prefs::kDisablePluginFinder, false); |
159 } | 159 } |
160 | 160 |
161 // static | 161 // static |
162 PluginFinder* PluginFinder::GetInstance() { | 162 PluginFinder* PluginFinder::GetInstance() { |
163 // PluginFinder::GetInstance() is the only method that's allowed to call | 163 // PluginFinder::GetInstance() is the only method that's allowed to call |
164 // Singleton<PluginFinder>::get(). | 164 // base::Singleton<PluginFinder>::get(). |
165 return Singleton<PluginFinder>::get(); | 165 return base::Singleton<PluginFinder>::get(); |
166 } | 166 } |
167 | 167 |
168 PluginFinder::PluginFinder() : version_(-1) { | 168 PluginFinder::PluginFinder() : version_(-1) { |
169 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 169 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
170 } | 170 } |
171 | 171 |
172 void PluginFinder::Init() { | 172 void PluginFinder::Init() { |
173 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 173 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
174 // Load the built-in plugin list first. If we have a newer version stored | 174 // Load the built-in plugin list first. If we have a newer version stored |
175 // locally or download one, we will replace this one with it. | 175 // locally or download one, we will replace this one with it. |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 metadata->AddMatchingMimeType(plugin.mime_types[i].mime_type); | 376 metadata->AddMatchingMimeType(plugin.mime_types[i].mime_type); |
377 | 377 |
378 DCHECK(metadata->MatchesPlugin(plugin)); | 378 DCHECK(metadata->MatchesPlugin(plugin)); |
379 if (identifier_plugin_.find(identifier) != identifier_plugin_.end()) | 379 if (identifier_plugin_.find(identifier) != identifier_plugin_.end()) |
380 identifier = GetLongIdentifier(plugin); | 380 identifier = GetLongIdentifier(plugin); |
381 | 381 |
382 DCHECK(identifier_plugin_.find(identifier) == identifier_plugin_.end()); | 382 DCHECK(identifier_plugin_.find(identifier) == identifier_plugin_.end()); |
383 identifier_plugin_[identifier] = metadata; | 383 identifier_plugin_[identifier] = metadata; |
384 return metadata->Clone(); | 384 return metadata->Clone(); |
385 } | 385 } |
OLD | NEW |