Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: chrome/browser/ui/startup/autolaunch_prompt_win.cc

Issue 14307023: chrome: Use base::MessageLoop. (Part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698