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_prefs.h" | 5 #include "chrome/browser/plugins/plugin_prefs.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
14 #include "base/prefs/scoped_user_pref_update.h" | 14 #include "base/prefs/scoped_user_pref_update.h" |
15 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
| 16 #include "base/strings/pattern.h" |
16 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
17 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
18 #include "base/thread_task_runner_handle.h" | 19 #include "base/thread_task_runner_handle.h" |
19 #include "base/values.h" | 20 #include "base/values.h" |
20 #include "build/build_config.h" | 21 #include "build/build_config.h" |
21 #include "chrome/browser/browser_process.h" | 22 #include "chrome/browser/browser_process.h" |
22 #include "chrome/browser/chrome_notification_types.h" | 23 #include "chrome/browser/chrome_notification_types.h" |
23 #include "chrome/browser/plugins/plugin_installer.h" | 24 #include "chrome/browser/plugins/plugin_installer.h" |
24 #include "chrome/browser/plugins/plugin_metadata.h" | 25 #include "chrome/browser/plugins/plugin_metadata.h" |
25 #include "chrome/browser/plugins/plugin_prefs_factory.h" | 26 #include "chrome/browser/plugins/plugin_prefs_factory.h" |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 | 282 |
282 NotifyPluginStatusChanged(); | 283 NotifyPluginStatusChanged(); |
283 } | 284 } |
284 | 285 |
285 /*static*/ | 286 /*static*/ |
286 bool PluginPrefs::IsStringMatchedInSet( | 287 bool PluginPrefs::IsStringMatchedInSet( |
287 const base::string16& name, | 288 const base::string16& name, |
288 const std::set<base::string16>& pattern_set) { | 289 const std::set<base::string16>& pattern_set) { |
289 std::set<base::string16>::const_iterator pattern(pattern_set.begin()); | 290 std::set<base::string16>::const_iterator pattern(pattern_set.begin()); |
290 while (pattern != pattern_set.end()) { | 291 while (pattern != pattern_set.end()) { |
291 if (MatchPattern(name, *pattern)) | 292 if (base::MatchPattern(name, *pattern)) |
292 return true; | 293 return true; |
293 ++pattern; | 294 ++pattern; |
294 } | 295 } |
295 | 296 |
296 return false; | 297 return false; |
297 } | 298 } |
298 | 299 |
299 /* static */ | 300 /* static */ |
300 void PluginPrefs::ListValueToStringSet(const base::ListValue* src, | 301 void PluginPrefs::ListValueToStringSet(const base::ListValue* src, |
301 std::set<base::string16>* dest) { | 302 std::set<base::string16>* dest) { |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 } | 581 } |
581 } | 582 } |
582 | 583 |
583 void PluginPrefs::NotifyPluginStatusChanged() { | 584 void PluginPrefs::NotifyPluginStatusChanged() { |
584 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 585 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
585 content::NotificationService::current()->Notify( | 586 content::NotificationService::current()->Notify( |
586 chrome::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED, | 587 chrome::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED, |
587 content::Source<Profile>(profile_), | 588 content::Source<Profile>(profile_), |
588 content::NotificationService::NoDetails()); | 589 content::NotificationService::NoDetails()); |
589 } | 590 } |
OLD | NEW |