| 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/extensions/default_apps.h" | 5 #include "chrome/browser/extensions/default_apps.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #if !defined(OS_ANDROID) | 9 #if !defined(OS_ANDROID) |
| 10 #include "chrome/browser/first_run/first_run.h" | 10 #include "chrome/browser/first_run/first_run.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 case kNeverInstallDefaultApps: | 107 case kNeverInstallDefaultApps: |
| 108 install_apps = false; | 108 install_apps = false; |
| 109 break; | 109 break; |
| 110 default: | 110 default: |
| 111 NOTREACHED(); | 111 NOTREACHED(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 if (install_apps && !IsLocaleSupported()) | 114 if (install_apps && !IsLocaleSupported()) |
| 115 install_apps = false; | 115 install_apps = false; |
| 116 | 116 |
| 117 if (CommandLine::ForCurrentProcess()->HasSwitch( | |
| 118 switches::kDisableDefaultApps)) { | |
| 119 install_apps = false; | |
| 120 } | |
| 121 | |
| 122 // Default apps are only installed on profile creation or a new chrome | 117 // Default apps are only installed on profile creation or a new chrome |
| 123 // download. | 118 // download. |
| 124 if (state == kUnknown) { | 119 if (state == kUnknown) { |
| 125 if (install_apps) { | 120 if (install_apps) { |
| 126 profile_->GetPrefs()->SetInteger(prefs::kDefaultAppsInstallState, | 121 profile_->GetPrefs()->SetInteger(prefs::kDefaultAppsInstallState, |
| 127 kAlreadyInstalledDefaultApps); | 122 kAlreadyInstalledDefaultApps); |
| 128 } else { | 123 } else { |
| 129 profile_->GetPrefs()->SetInteger(prefs::kDefaultAppsInstallState, | 124 profile_->GetPrefs()->SetInteger(prefs::kDefaultAppsInstallState, |
| 130 kNeverInstallDefaultApps); | 125 kNeverInstallDefaultApps); |
| 131 } | 126 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 for (std::set<std::string>::iterator it = new_default_apps.begin(); | 166 for (std::set<std::string>::iterator it = new_default_apps.begin(); |
| 172 it != new_default_apps.end(); ++it) { | 167 it != new_default_apps.end(); ++it) { |
| 173 prefs->Remove(*it, NULL); | 168 prefs->Remove(*it, NULL); |
| 174 } | 169 } |
| 175 } | 170 } |
| 176 | 171 |
| 177 ExternalProviderImpl::SetPrefs(prefs); | 172 ExternalProviderImpl::SetPrefs(prefs); |
| 178 } | 173 } |
| 179 | 174 |
| 180 } // namespace default_apps | 175 } // namespace default_apps |
| OLD | NEW |