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

Unified Diff: chrome/browser/chromeos/file_system_provider/registry.cc

Issue 1077823005: Declare providing extension capabilities in the manifest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed tests. Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/file_system_provider/registry.cc
diff --git a/chrome/browser/chromeos/file_system_provider/registry.cc b/chrome/browser/chromeos/file_system_provider/registry.cc
index d6d6404e7cd42a1a84cfac43302e626f78cb883f..e301279b6762deb87b2be57b6d772c1932ad7e7f 100644
--- a/chrome/browser/chromeos/file_system_provider/registry.cc
+++ b/chrome/browser/chromeos/file_system_provider/registry.cc
@@ -26,7 +26,6 @@ namespace file_system_provider {
const char kPrefKeyFileSystemId[] = "file-system-id";
const char kPrefKeyDisplayName[] = "display-name";
const char kPrefKeyWritable[] = "writable";
-const char kPrefKeySource[] = "source";
const char kPrefKeySupportsNotifyTag[] = "supports-notify-tag";
const char kPrefKeyWatchers[] = "watchers";
const char kPrefKeyWatcherEntryPath[] = "entry-path";
@@ -39,41 +38,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterDictionaryPref(prefs::kFileSystemProviderMounted);
}
-std::string SourceToString(Source source) {
- switch (source) {
- case SOURCE_UNKNOWN:
- return "unknown";
- case SOURCE_FILE:
- return "file";
- case SOURCE_DEVICE:
- return "device";
- case SOURCE_NETWORK:
- return "network";
- }
- NOTREACHED();
- return std::string();
-}
-
-bool StringToSource(const std::string& source, Source* result) {
- if (source.compare("unknown") == 0) {
- *result = SOURCE_UNKNOWN;
- return true;
- }
- if (source.compare("file") == 0) {
- *result = SOURCE_FILE;
- return true;
- }
- if (source.compare("device") == 0) {
- *result = SOURCE_DEVICE;
- return true;
- }
- if (source.compare("network") == 0) {
- *result = SOURCE_NETWORK;
- return true;
- }
- return false;
-}
-
Registry::Registry(Profile* profile) : profile_(profile) {
}
@@ -90,8 +54,6 @@ void Registry::RememberFileSystem(
file_system_info.display_name());
file_system->SetBooleanWithoutPathExpansion(kPrefKeyWritable,
file_system_info.writable());
- file_system->SetStringWithoutPathExpansion(
- kPrefKeySource, SourceToString(file_system_info.source()));
file_system->SetBooleanWithoutPathExpansion(
kPrefKeySupportsNotifyTag, file_system_info.supports_notify_tag());
file_system->SetIntegerWithoutPathExpansion(
@@ -189,8 +151,6 @@ scoped_ptr<Registry::RestoredFileSystems> Registry::RestoreFileSystems(
bool writable = false;
bool supports_notify_tag = false;
int opened_files_limit = 0;
- std::string source_as_string;
- Source source = SOURCE_UNKNOWN;
// TODO(mtomasz): Move opened files limit to the mandatory list above in
// M42.
@@ -207,9 +167,7 @@ scoped_ptr<Registry::RestoredFileSystems> Registry::RestoreFileSystems(
// Optional fields.
(file_system->GetIntegerWithoutPathExpansion(kPrefKeyOpenedFilesLimit,
&opened_files_limit) &&
- (file_system->GetStringWithoutPathExpansion(kPrefKeySource,
- &source_as_string) &&
- !StringToSource(source_as_string, &source)))) {
+ opened_files_limit < 0)) {
LOG(ERROR)
<< "Malformed provided file system information in preferences.";
continue;
@@ -219,7 +177,6 @@ scoped_ptr<Registry::RestoredFileSystems> Registry::RestoreFileSystems(
options.file_system_id = file_system_id;
options.display_name = display_name;
options.writable = writable;
- options.source = source;
options.supports_notify_tag = supports_notify_tag;
options.opened_files_limit = opened_files_limit;

Powered by Google App Engine
This is Rietveld 408576698