OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/extensions/default_apps_trial.h" | 10 #include "chrome/browser/extensions/default_apps_trial.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 break; | 70 break; |
71 } | 71 } |
72 } | 72 } |
73 } | 73 } |
74 | 74 |
75 if (CommandLine::ForCurrentProcess()->HasSwitch( | 75 if (CommandLine::ForCurrentProcess()->HasSwitch( |
76 switches::kDisableDefaultApps)) { | 76 switches::kDisableDefaultApps)) { |
77 install_apps = false; | 77 install_apps = false; |
78 } | 78 } |
79 | 79 |
80 if (base::FieldTrialList::TrialExists(kDefaultAppsTrial_Name)) { | 80 if (base::FieldTrialList::TrialExists(kDefaultAppsTrialName)) { |
81 install_apps = base::FieldTrialList::Find( | 81 install_apps = base::FieldTrialList::Find( |
82 kDefaultAppsTrial_Name)->group_name() != kDefaultAppsTrial_NoAppsGroup; | 82 kDefaultAppsTrialName)->group_name() != kDefaultAppsTrialNoAppsGroup; |
83 } | 83 } |
84 | 84 |
85 // Save the state if needed. | 85 // Save the state if needed. |
86 if (state == default_apps::kUnknown) { | 86 if (state == default_apps::kUnknown) { |
87 if (install_apps) { | 87 if (install_apps) { |
88 profile->GetPrefs()->SetInteger(prefs::kDefaultAppsInstallState, | 88 profile->GetPrefs()->SetInteger(prefs::kDefaultAppsInstallState, |
89 default_apps::kAlwaysProvideDefaultApps); | 89 default_apps::kAlwaysProvideDefaultApps); |
90 } else { | 90 } else { |
91 profile->GetPrefs()->SetInteger(prefs::kDefaultAppsInstallState, | 91 profile->GetPrefs()->SetInteger(prefs::kDefaultAppsInstallState, |
92 default_apps::kNeverProvideDefaultApps); | 92 default_apps::kNeverProvideDefaultApps); |
(...skipping 27 matching lines...) Expand all Loading... |
120 if (!profile_ || !ShouldInstallInProfile(profile_)) { | 120 if (!profile_ || !ShouldInstallInProfile(profile_)) { |
121 base::DictionaryValue* prefs = new base::DictionaryValue; | 121 base::DictionaryValue* prefs = new base::DictionaryValue; |
122 SetPrefs(prefs); | 122 SetPrefs(prefs); |
123 return; | 123 return; |
124 } | 124 } |
125 | 125 |
126 ExternalExtensionProviderImpl::VisitRegisteredExtension(); | 126 ExternalExtensionProviderImpl::VisitRegisteredExtension(); |
127 } | 127 } |
128 | 128 |
129 } // namespace default_apps | 129 } // namespace default_apps |
OLD | NEW |