Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: chrome/browser/content_settings/host_content_settings_map.cc

Issue 380893005: Add an option page for searching and managing resources and permissions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Last pass. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698