diff options
14 files changed, 55 insertions, 54 deletions
diff --git a/chrome/browser/chromeos/drive/drive_file_system.cc b/chrome/browser/chromeos/drive/drive_file_system.cc index 188a0ae..ba9e120 100644 --- a/chrome/browser/chromeos/drive/drive_file_system.cc +++ b/chrome/browser/chromeos/drive/drive_file_system.cc @@ -409,7 +409,7 @@ void DriveFileSystem::Initialize() { this); // OperationObserver PrefService* pref_service = profile_->GetPrefs(); - hide_hosted_docs_ = pref_service->GetBoolean(prefs::kDisableGDataHostedFiles); + hide_hosted_docs_ = pref_service->GetBoolean(prefs::kDisableDriveHostedFiles); scheduler_->Initialize(); @@ -2169,9 +2169,9 @@ void DriveFileSystem::Observe(int type, if (type == chrome::NOTIFICATION_PREF_CHANGED) { PrefService* pref_service = profile_->GetPrefs(); std::string* pref_name = content::Details<std::string>(details).ptr(); - if (*pref_name == prefs::kDisableGDataHostedFiles) { + if (*pref_name == prefs::kDisableDriveHostedFiles) { SetHideHostedDocuments( - pref_service->GetBoolean(prefs::kDisableGDataHostedFiles)); + pref_service->GetBoolean(prefs::kDisableDriveHostedFiles)); } } else { NOTREACHED(); @@ -2199,7 +2199,7 @@ void DriveFileSystem::InitializePreferenceObserver() { pref_registrar_.reset(new PrefChangeRegistrar()); pref_registrar_->Init(profile_->GetPrefs()); - pref_registrar_->Add(prefs::kDisableGDataHostedFiles, this); + pref_registrar_->Add(prefs::kDisableDriveHostedFiles, this); } void DriveFileSystem::OpenFile(const FilePath& file_path, diff --git a/chrome/browser/chromeos/drive/drive_scheduler.cc b/chrome/browser/chromeos/drive/drive_scheduler.cc index e4bee99..c2e4eb3 100644 --- a/chrome/browser/chromeos/drive/drive_scheduler.cc +++ b/chrome/browser/chromeos/drive/drive_scheduler.cc @@ -156,7 +156,7 @@ void DriveScheduler::DoJobLoop() { bool DriveScheduler::ShouldStopJobLoop() { // Should stop if the gdata feature was disabled while running the fetch // loop. - if (profile_->GetPrefs()->GetBoolean(prefs::kDisableGData)) + if (profile_->GetPrefs()->GetBoolean(prefs::kDisableDrive)) return true; // Should stop if the network is not online. @@ -165,7 +165,7 @@ bool DriveScheduler::ShouldStopJobLoop() { // Should stop if the current connection is on cellular network, and // fetching is disabled over cellular. - if (profile_->GetPrefs()->GetBoolean(prefs::kDisableGDataOverCellular) && + if (profile_->GetPrefs()->GetBoolean(prefs::kDisableDriveOverCellular) && util::IsConnectionTypeCellular()) return true; diff --git a/chrome/browser/chromeos/drive/drive_scheduler_unittest.cc b/chrome/browser/chromeos/drive/drive_scheduler_unittest.cc index 2fd9329..a42c96a 100644 --- a/chrome/browser/chromeos/drive/drive_scheduler_unittest.cc +++ b/chrome/browser/chromeos/drive/drive_scheduler_unittest.cc @@ -185,7 +185,7 @@ TEST_F(DriveSchedulerTest, QueueOperation_CelluarDisabled) { TEST_F(DriveSchedulerTest, QueueOperation_CelluarEnabled) { // Enable fetching over cellular network. - profile_->GetPrefs()->SetBoolean(prefs::kDisableGDataOverCellular, false); + profile_->GetPrefs()->SetBoolean(prefs::kDisableDriveOverCellular, false); ConnectToCellular(); @@ -219,7 +219,7 @@ TEST_F(DriveSchedulerTest, QueueOperation_WimaxDisabled) { TEST_F(DriveSchedulerTest, QueueOperation_CelluarEnabledWithWimax) { // Enable fetching over cellular network. - profile_->GetPrefs()->SetBoolean(prefs::kDisableGDataOverCellular, false); + profile_->GetPrefs()->SetBoolean(prefs::kDisableDriveOverCellular, false); ConnectToWimax(); @@ -237,7 +237,7 @@ TEST_F(DriveSchedulerTest, QueueOperation_CelluarEnabledWithWimax) { TEST_F(DriveSchedulerTest, QueueOperation_DriveDisabled) { // Disable the Drive feature. - profile_->GetPrefs()->SetBoolean(prefs::kDisableGData, true); + profile_->GetPrefs()->SetBoolean(prefs::kDisableDrive, true); // This file will not be removed, as the Drive feature is disabled. EXPECT_CALL(*mock_remove_operation_, Remove(_, _, _)).Times(0); diff --git a/chrome/browser/chromeos/drive/drive_sync_client.cc b/chrome/browser/chromeos/drive/drive_sync_client.cc index a179235..7cd90fa 100644 --- a/chrome/browser/chromeos/drive/drive_sync_client.cc +++ b/chrome/browser/chromeos/drive/drive_sync_client.cc @@ -100,8 +100,8 @@ void DriveSyncClient::Initialize() { net::NetworkChangeNotifier::AddConnectionTypeObserver(this); registrar_->Init(profile_->GetPrefs()); - registrar_->Add(prefs::kDisableGData, this); - registrar_->Add(prefs::kDisableGDataOverCellular, this); + registrar_->Add(prefs::kDisableDrive, this); + registrar_->Add(prefs::kDisableDriveOverCellular, this); } void DriveSyncClient::StartProcessingBacklog() { @@ -195,7 +195,7 @@ void DriveSyncClient::DoSyncLoop() { bool DriveSyncClient::ShouldStopSyncLoop() { // Should stop if the drive feature was disabled while running the fetch // loop. - if (profile_->GetPrefs()->GetBoolean(prefs::kDisableGData)) + if (profile_->GetPrefs()->GetBoolean(prefs::kDisableDrive)) return true; // Should stop if the network is not online. @@ -204,7 +204,7 @@ bool DriveSyncClient::ShouldStopSyncLoop() { // Should stop if the current connection is on cellular network, and // fetching is disabled over cellular. - if (profile_->GetPrefs()->GetBoolean(prefs::kDisableGDataOverCellular) && + if (profile_->GetPrefs()->GetBoolean(prefs::kDisableDriveOverCellular) && util::IsConnectionTypeCellular()) return true; diff --git a/chrome/browser/chromeos/drive/drive_sync_client_unittest.cc b/chrome/browser/chromeos/drive/drive_sync_client_unittest.cc index c3e1bd0..14afd8f 100644 --- a/chrome/browser/chromeos/drive/drive_sync_client_unittest.cc +++ b/chrome/browser/chromeos/drive/drive_sync_client_unittest.cc @@ -389,7 +389,7 @@ TEST_F(DriveSyncClientTest, StartSyncLoop_CelluarEnabled) { ConnectToWifi(); // First connect to Wifi. // Enable fetching over cellular network. - profile_->GetPrefs()->SetBoolean(prefs::kDisableGDataOverCellular, false); + profile_->GetPrefs()->SetBoolean(prefs::kDisableDriveOverCellular, false); AddResourceIdToFetch("resource_id_not_fetched_foo"); AddResourceIdToFetch("resource_id_not_fetched_bar"); @@ -428,7 +428,7 @@ TEST_F(DriveSyncClientTest, StartSyncLoop_CelluarEnabledWithWimax) { ConnectToWifi(); // First connect to Wifi. // Enable fetching over cellular network. This includes wimax. - profile_->GetPrefs()->SetBoolean(prefs::kDisableGDataOverCellular, false); + profile_->GetPrefs()->SetBoolean(prefs::kDisableDriveOverCellular, false); AddResourceIdToFetch("resource_id_not_fetched_foo"); AddResourceIdToFetch("resource_id_not_fetched_bar"); @@ -451,7 +451,7 @@ TEST_F(DriveSyncClientTest, StartSyncLoop_DriveDisabled) { ConnectToWifi(); // Disable the Drive feature. - profile_->GetPrefs()->SetBoolean(prefs::kDisableGData, true); + profile_->GetPrefs()->SetBoolean(prefs::kDisableDrive, true); AddResourceIdToFetch("resource_id_not_fetched_foo"); AddResourceIdToFetch("resource_id_not_fetched_bar"); diff --git a/chrome/browser/chromeos/drive/drive_system_service.cc b/chrome/browser/chromeos/drive/drive_system_service.cc index e8527b9..0ed24f46 100644 --- a/chrome/browser/chromeos/drive/drive_system_service.cc +++ b/chrome/browser/chromeos/drive/drive_system_service.cc @@ -54,7 +54,7 @@ bool IsDriveEnabledForProfile(Profile* profile) { // Disable Drive if preference is set. This can happen with commandline flag // --disable-gdata or enterprise policy, or probably with user settings too // in the future. - if (profile->GetPrefs()->GetBoolean(prefs::kDisableGData)) + if (profile->GetPrefs()->GetBoolean(prefs::kDisableDrive)) return false; return true; diff --git a/chrome/browser/chromeos/extensions/file_browser_event_router.cc b/chrome/browser/chromeos/extensions/file_browser_event_router.cc index 96cbde2..5212a6e 100644 --- a/chrome/browser/chromeos/extensions/file_browser_event_router.cc +++ b/chrome/browser/chromeos/extensions/file_browser_event_router.cc @@ -153,9 +153,9 @@ void FileBrowserEventRouter::ObserveFileSystemEvents() { network_library->AddNetworkManagerObserver(this); pref_change_registrar_->Init(profile_->GetPrefs()); - pref_change_registrar_->Add(prefs::kDisableGDataOverCellular, this); - pref_change_registrar_->Add(prefs::kDisableGDataHostedFiles, this); - pref_change_registrar_->Add(prefs::kDisableGData, this); + pref_change_registrar_->Add(prefs::kDisableDriveOverCellular, this); + pref_change_registrar_->Add(prefs::kDisableDriveHostedFiles, this); + pref_change_registrar_->Add(prefs::kDisableDrive, this); pref_change_registrar_->Add(prefs::kUse24HourClock, this); pref_change_registrar_->Add(prefs::kExternalStorageDisabled, this); } @@ -406,9 +406,9 @@ void FileBrowserEventRouter::Observe( chromeos::UNMOUNT_OPTIONS_NONE); } return; - } else if (*pref_name == prefs::kDisableGDataOverCellular || - *pref_name == prefs::kDisableGDataHostedFiles || - *pref_name == prefs::kDisableGData || + } else if (*pref_name == prefs::kDisableDriveOverCellular || + *pref_name == prefs::kDisableDriveHostedFiles || + *pref_name == prefs::kDisableDrive || *pref_name == prefs::kUse24HourClock) { profile_->GetExtensionEventRouter()->DispatchEventToRenderers( extensions::event_names::kOnFileBrowserPreferencesChanged, diff --git a/chrome/browser/chromeos/extensions/file_browser_private_api.cc b/chrome/browser/chromeos/extensions/file_browser_private_api.cc index 9c4798f..545d968 100644 --- a/chrome/browser/chromeos/extensions/file_browser_private_api.cc +++ b/chrome/browser/chromeos/extensions/file_browser_private_api.cc @@ -2652,10 +2652,10 @@ bool GetPreferencesFunction::RunImpl() { value->SetBoolean("driveEnabled", drive_enabled); value->SetBoolean("cellularDisabled", - service->GetBoolean(prefs::kDisableGDataOverCellular)); + service->GetBoolean(prefs::kDisableDriveOverCellular)); value->SetBoolean("hostedFilesDisabled", - service->GetBoolean(prefs::kDisableGDataHostedFiles)); + service->GetBoolean(prefs::kDisableDriveHostedFiles)); value->SetBoolean("use24hourClock", service->GetBoolean(prefs::kUse24HourClock)); @@ -2675,13 +2675,11 @@ bool SetPreferencesFunction::RunImpl() { bool tmp; - if (value->GetBoolean("cellularDisabled", &tmp)) { - service->SetBoolean(prefs::kDisableGDataOverCellular, tmp); - } + if (value->GetBoolean("cellularDisabled", &tmp)) + service->SetBoolean(prefs::kDisableDriveOverCellular, tmp); - if (value->GetBoolean("hostedFilesDisabled", &tmp)) { - service->SetBoolean(prefs::kDisableGDataHostedFiles, tmp); - } + if (value->GetBoolean("hostedFilesDisabled", &tmp)) + service->SetBoolean(prefs::kDisableDriveHostedFiles, tmp); return true; } diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc index 8707897..4130085 100644 --- a/chrome/browser/chromeos/preferences.cc +++ b/chrome/browser/chromeos/preferences.cc @@ -121,13 +121,13 @@ void Preferences::RegisterUserPrefs(PrefService* prefs) { prefs->RegisterBooleanPref(prefs::kUse24HourClock, base::GetHourClockType() == base::k24HourClock, PrefService::SYNCABLE_PREF); - prefs->RegisterBooleanPref(prefs::kDisableGData, + prefs->RegisterBooleanPref(prefs::kDisableDrive, false, PrefService::SYNCABLE_PREF); - prefs->RegisterBooleanPref(prefs::kDisableGDataOverCellular, + prefs->RegisterBooleanPref(prefs::kDisableDriveOverCellular, true, PrefService::SYNCABLE_PREF); - prefs->RegisterBooleanPref(prefs::kDisableGDataHostedFiles, + prefs->RegisterBooleanPref(prefs::kDisableDriveHostedFiles, false, PrefService::SYNCABLE_PREF); // We don't sync prefs::kLanguageCurrentInputMethod and PreviousInputMethod @@ -290,10 +290,10 @@ void Preferences::InitUserPrefs(PrefService* prefs) { mouse_sensitivity_.Init(prefs::kMouseSensitivity, prefs, this); touchpad_sensitivity_.Init(prefs::kTouchpadSensitivity, prefs, this); use_24hour_clock_.Init(prefs::kUse24HourClock, prefs, this); - disable_drive_.Init(prefs::kDisableGData, prefs, this); - disable_drive_over_cellular_.Init(prefs::kDisableGDataOverCellular, + disable_drive_.Init(prefs::kDisableDrive, prefs, this); + disable_drive_over_cellular_.Init(prefs::kDisableDriveOverCellular, prefs, this); - disable_drive_hosted_files_.Init(prefs::kDisableGDataHostedFiles, + disable_drive_hosted_files_.Init(prefs::kDisableDriveHostedFiles, prefs, this); download_default_directory_.Init(prefs::kDownloadDefaultDirectory, prefs, this); @@ -627,9 +627,9 @@ void Preferences::NotifyPrefChanged(const std::string* pref_name) { system::ToggleDrm(enable_drm_.GetValue()); } - // Change the download directory to the default value if a GData directory is - // selected and GData is disabled. - if (!pref_name || *pref_name == prefs::kDisableGData) { + // Change the download directory to the default value if a Drive directory is + // selected and Drive is disabled. + if (!pref_name || *pref_name == prefs::kDisableDrive) { if (disable_drive_.GetValue()) { if (drive::util::IsUnderDriveMountPoint( download_default_directory_.GetValue())) { diff --git a/chrome/browser/policy/configuration_policy_handler_list.cc b/chrome/browser/policy/configuration_policy_handler_list.cc index 7e0157a..efafebe 100644 --- a/chrome/browser/policy/configuration_policy_handler_list.cc +++ b/chrome/browser/policy/configuration_policy_handler_list.cc @@ -312,10 +312,10 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = { prefs::kChromeOsReleaseChannel, Value::TYPE_STRING }, { key::kGDataDisabled, - prefs::kDisableGData, + prefs::kDisableDrive, Value::TYPE_BOOLEAN }, { key::kGDataDisabledOverCellular, - prefs::kDisableGDataOverCellular, + prefs::kDisableDriveOverCellular, Value::TYPE_BOOLEAN }, { key::kExternalStorageDisabled, prefs::kExternalStorageDisabled, diff --git a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc index 46e8cbf..c071356 100644 --- a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc +++ b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc @@ -288,9 +288,9 @@ INSTANTIATE_TEST_CASE_P( PolicyAndPref(key::kChromeOsLockOnIdleSuspend, prefs::kEnableScreenLock), PolicyAndPref(key::kGDataDisabled, - prefs::kDisableGData), + prefs::kDisableDrive), PolicyAndPref(key::kGDataDisabledOverCellular, - prefs::kDisableGDataOverCellular), + prefs::kDisableDriveOverCellular), PolicyAndPref(key::kExternalStorageDisabled, prefs::kExternalStorageDisabled), PolicyAndPref(key::kAudioOutputAllowed, diff --git a/chrome/browser/prefs/command_line_pref_store.cc b/chrome/browser/prefs/command_line_pref_store.cc index 5d36fe6..1225dad 100644 --- a/chrome/browser/prefs/command_line_pref_store.cc +++ b/chrome/browser/prefs/command_line_pref_store.cc @@ -60,7 +60,7 @@ const CommandLinePrefStore::BooleanSwitchToPreferenceMapEntry { switches::kEnablePrintPreview, prefs::kPrintPreviewDisabled, false }, #endif #if defined(OS_CHROMEOS) - { switches::kDisableDrive, prefs::kDisableGData, true }, + { switches::kDisableDrive, prefs::kDisableDrive, true }, { switches::kEnableTouchpadThreeFingerClick, prefs::kEnableTouchpadThreeFingerClick, true }, #endif diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index 8ebff59..9434e81 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc @@ -555,14 +555,17 @@ const char kTouchpadSensitivity[] = "settings.touchpad.sensitivity2"; // A boolean pref set to true if time should be displayed in 24-hour clock. const char kUse24HourClock[] = "settings.clock.use_24hour_clock"; -// A boolean pref to disable gdata. -const char kDisableGData[] = "gdata.disabled"; +// A boolean pref to disable Google Drive integration. +// The pref prefix should remain as "gdata" for backward compatibility. +const char kDisableDrive[] = "gdata.disabled"; -// A boolean pref to disable gdata over cellular connections. -const char kDisableGDataOverCellular[] = "gdata.cellular.disabled"; +// A boolean pref to disable Drive over cellular connections. +// The pref prefix should remain as "gdata" for backward compatibility. +const char kDisableDriveOverCellular[] = "gdata.cellular.disabled"; -// A boolean pref to disable gdata hosted files. -const char kDisableGDataHostedFiles[] = "gdata.hosted_files.disabled"; +// A boolean pref to disable hosted files on Drive. +// The pref prefix should remain as "gdata" for backward compatibility. +const char kDisableDriveHostedFiles[] = "gdata.hosted_files.disabled"; // A string pref set to the current input method. const char kLanguageCurrentInputMethod[] = diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index 323d072..fc681bd 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h @@ -200,9 +200,9 @@ extern const char kPrimaryMouseButtonRight[]; extern const char kMouseSensitivity[]; extern const char kTouchpadSensitivity[]; extern const char kUse24HourClock[]; -extern const char kDisableGData[]; -extern const char kDisableGDataOverCellular[]; -extern const char kDisableGDataHostedFiles[]; +extern const char kDisableDrive[]; +extern const char kDisableDriveOverCellular[]; +extern const char kDisableDriveHostedFiles[]; // TODO(yusukes): Change "kLanguageABC" to "kABC". The current form is too long // to remember and confusing. The prefs are actually for input methods and i18n // keyboards, not UI languages. |