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/ui/cocoa/keystone_infobar_delegate.h" | 5 #include "chrome/browser/ui/cocoa/keystone_infobar_delegate.h" |
6 | 6 |
7 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 } | 153 } |
154 | 154 |
155 - (void)checkAndShowInfoBarForProfile:(Profile*)profile { | 155 - (void)checkAndShowInfoBarForProfile:(Profile*)profile { |
156 // If this is the first run, the user clicked the "don't ask again" button | 156 // If this is the first run, the user clicked the "don't ask again" button |
157 // at some point in the past, or if the "don't ask about the default | 157 // at some point in the past, or if the "don't ask about the default |
158 // browser" command-line switch is present, bail out. That command-line | 158 // browser" command-line switch is present, bail out. That command-line |
159 // switch is recycled here because it's likely that the set of users that | 159 // switch is recycled here because it's likely that the set of users that |
160 // don't want to be nagged about the default browser also don't want to be | 160 // don't want to be nagged about the default browser also don't want to be |
161 // nagged about the update check. (Automated testers, I'm thinking of | 161 // nagged about the update check. (Automated testers, I'm thinking of |
162 // you...) | 162 // you...) |
163 CommandLine* commandLine = CommandLine::ForCurrentProcess(); | 163 base::CommandLine* commandLine = base::CommandLine::ForCurrentProcess(); |
164 if (first_run::IsChromeFirstRun() || | 164 if (first_run::IsChromeFirstRun() || |
165 !profile->GetPrefs()->GetBoolean(prefs::kShowUpdatePromotionInfoBar) || | 165 !profile->GetPrefs()->GetBoolean(prefs::kShowUpdatePromotionInfoBar) || |
166 commandLine->HasSwitch(switches::kNoDefaultBrowserCheck)) { | 166 commandLine->HasSwitch(switches::kNoDefaultBrowserCheck)) { |
167 return; | 167 return; |
168 } | 168 } |
169 | 169 |
170 // If there is no Keystone glue (maybe because this application isn't | 170 // If there is no Keystone glue (maybe because this application isn't |
171 // Keystone-enabled) or the application is on a read-only filesystem, | 171 // Keystone-enabled) or the application is on a read-only filesystem, |
172 // doing anything related to auto-update is pointless. Bail out. | 172 // doing anything related to auto-update is pointless. Bail out. |
173 KeystoneGlue* keystoneGlue = [KeystoneGlue defaultKeystoneGlue]; | 173 KeystoneGlue* keystoneGlue = [KeystoneGlue defaultKeystoneGlue]; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 | 217 |
218 @end // @implementation KeystonePromotionInfoBar | 218 @end // @implementation KeystonePromotionInfoBar |
219 | 219 |
220 // static | 220 // static |
221 void KeystoneInfoBar::PromotionInfoBar(Profile* profile) { | 221 void KeystoneInfoBar::PromotionInfoBar(Profile* profile) { |
222 KeystonePromotionInfoBar* promotionInfoBar = | 222 KeystonePromotionInfoBar* promotionInfoBar = |
223 [[[KeystonePromotionInfoBar alloc] init] autorelease]; | 223 [[[KeystonePromotionInfoBar alloc] init] autorelease]; |
224 | 224 |
225 [promotionInfoBar checkAndShowInfoBarForProfile:profile]; | 225 [promotionInfoBar checkAndShowInfoBarForProfile:profile]; |
226 } | 226 } |
OLD | NEW |