| 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/content_settings/host_content_settings_map.h" | 5 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 using base::UserMetricsAction; | 44 using base::UserMetricsAction; |
| 45 using content::BrowserThread; | 45 using content::BrowserThread; |
| 46 | 46 |
| 47 namespace { | 47 namespace { |
| 48 | 48 |
| 49 typedef std::vector<content_settings::Rule> Rules; | 49 typedef std::vector<content_settings::Rule> Rules; |
| 50 | 50 |
| 51 typedef std::pair<std::string, std::string> StringPair; | 51 typedef std::pair<std::string, std::string> StringPair; |
| 52 | 52 |
| 53 // TODO(bauerb): Expose constants. |
| 53 const char* kProviderNames[] = { | 54 const char* kProviderNames[] = { |
| 54 "platform_app", | 55 "platform_app", |
| 55 "policy", | 56 "policy", |
| 56 "extension", | 57 "extension", |
| 57 "preference", | 58 "preference", |
| 58 "default" | 59 "default" |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 content_settings::SettingSource kProviderSourceMap[] = { | 62 content_settings::SettingSource kProviderSourceMap[] = { |
| 62 content_settings::SETTING_SOURCE_EXTENSION, | 63 content_settings::SETTING_SOURCE_EXTENSION, |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 HostContentSettingsMap::GetProviderTypeFromSource( | 632 HostContentSettingsMap::GetProviderTypeFromSource( |
| 632 const std::string& source) { | 633 const std::string& source) { |
| 633 for (size_t i = 0; i < arraysize(kProviderNames); ++i) { | 634 for (size_t i = 0; i < arraysize(kProviderNames); ++i) { |
| 634 if (source == kProviderNames[i]) | 635 if (source == kProviderNames[i]) |
| 635 return static_cast<ProviderType>(i); | 636 return static_cast<ProviderType>(i); |
| 636 } | 637 } |
| 637 | 638 |
| 638 NOTREACHED(); | 639 NOTREACHED(); |
| 639 return DEFAULT_PROVIDER; | 640 return DEFAULT_PROVIDER; |
| 640 } | 641 } |
| OLD | NEW |