| 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/startup/autolaunch_prompt.h" | 5 #include "chrome/browser/ui/startup/autolaunch_prompt.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 // Used to delay the expiration of the info-bar. | 64 // Used to delay the expiration of the info-bar. |
| 65 base::WeakPtrFactory<AutolaunchInfoBarDelegate> weak_factory_; | 65 base::WeakPtrFactory<AutolaunchInfoBarDelegate> weak_factory_; |
| 66 | 66 |
| 67 DISALLOW_COPY_AND_ASSIGN(AutolaunchInfoBarDelegate); | 67 DISALLOW_COPY_AND_ASSIGN(AutolaunchInfoBarDelegate); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 // static | 70 // static |
| 71 void AutolaunchInfoBarDelegate::Create(InfoBarService* infobar_service, | 71 void AutolaunchInfoBarDelegate::Create(InfoBarService* infobar_service, |
| 72 Profile* profile) { | 72 Profile* profile) { |
| 73 infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( | 73 infobar_service->AddInfoBar( |
| 74 scoped_ptr<ConfirmInfoBarDelegate>( | 74 infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( |
| 75 new AutolaunchInfoBarDelegate(profile)))); | 75 new AutolaunchInfoBarDelegate(profile)))); |
| 76 } | 76 } |
| 77 | 77 |
| 78 AutolaunchInfoBarDelegate::AutolaunchInfoBarDelegate( | 78 AutolaunchInfoBarDelegate::AutolaunchInfoBarDelegate( |
| 79 Profile* profile) | 79 Profile* profile) |
| 80 : ConfirmInfoBarDelegate(), | 80 : ConfirmInfoBarDelegate(), |
| 81 profile_(profile), | 81 profile_(profile), |
| 82 should_expire_(false), | 82 should_expire_(false), |
| 83 weak_factory_(this) { | 83 weak_factory_(this) { |
| 84 PrefService* prefs = profile->GetPrefs(); | 84 PrefService* prefs = profile->GetPrefs(); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 return true; | 166 return true; |
| 167 } | 167 } |
| 168 | 168 |
| 169 void RegisterAutolaunchUserPrefs(user_prefs::PrefRegistrySyncable* registry) { | 169 void RegisterAutolaunchUserPrefs(user_prefs::PrefRegistrySyncable* registry) { |
| 170 registry->RegisterIntegerPref( | 170 registry->RegisterIntegerPref( |
| 171 prefs::kShownAutoLaunchInfobar, 0, | 171 prefs::kShownAutoLaunchInfobar, 0, |
| 172 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 172 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 173 } | 173 } |
| 174 | 174 |
| 175 } // namespace chrome | 175 } // namespace chrome |
| OLD | NEW |