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.h" | 8 #include "base/message_loop.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 : ConfirmInfoBarDelegate(infobar_service), | 91 : ConfirmInfoBarDelegate(infobar_service), |
92 prefs_(prefs), | 92 prefs_(prefs), |
93 should_expire_(false), | 93 should_expire_(false), |
94 profile_(profile), | 94 profile_(profile), |
95 weak_factory_(this) { | 95 weak_factory_(this) { |
96 int count = prefs_->GetInteger(prefs::kShownAutoLaunchInfobar); | 96 int count = prefs_->GetInteger(prefs::kShownAutoLaunchInfobar); |
97 prefs_->SetInteger(prefs::kShownAutoLaunchInfobar, count + 1); | 97 prefs_->SetInteger(prefs::kShownAutoLaunchInfobar, count + 1); |
98 | 98 |
99 // We want the info-bar to stick-around for a few seconds and then be hidden | 99 // We want the info-bar to stick-around for a few seconds and then be hidden |
100 // on the next navigation after that. | 100 // on the next navigation after that. |
101 MessageLoop::current()->PostDelayedTask( | 101 base::MessageLoop::current()->PostDelayedTask( |
102 FROM_HERE, | 102 FROM_HERE, |
103 base::Bind(&AutolaunchInfoBarDelegate::AllowExpiry, | 103 base::Bind(&AutolaunchInfoBarDelegate::AllowExpiry, |
104 weak_factory_.GetWeakPtr()), | 104 weak_factory_.GetWeakPtr()), |
105 base::TimeDelta::FromSeconds(8)); | 105 base::TimeDelta::FromSeconds(8)); |
106 } | 106 } |
107 | 107 |
108 AutolaunchInfoBarDelegate::~AutolaunchInfoBarDelegate() { | 108 AutolaunchInfoBarDelegate::~AutolaunchInfoBarDelegate() { |
109 } | 109 } |
110 | 110 |
111 gfx::Image* AutolaunchInfoBarDelegate::GetIcon() const { | 111 gfx::Image* AutolaunchInfoBarDelegate::GetIcon() const { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 } | 183 } |
184 | 184 |
185 void RegisterAutolaunchUserPrefs(user_prefs::PrefRegistrySyncable* registry) { | 185 void RegisterAutolaunchUserPrefs(user_prefs::PrefRegistrySyncable* registry) { |
186 registry->RegisterIntegerPref( | 186 registry->RegisterIntegerPref( |
187 prefs::kShownAutoLaunchInfobar, | 187 prefs::kShownAutoLaunchInfobar, |
188 0, | 188 0, |
189 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 189 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
190 } | 190 } |
191 | 191 |
192 } // namespace chrome | 192 } // namespace chrome |
OLD | NEW |