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

Side by Side Diff: chrome/browser/ui/startup/default_browser_prompt.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/default_browser_prompt.h" 5 #include "chrome/browser/ui/startup/default_browser_prompt.h"
6 6
7 #include "base/memory/weak_ptr.h" 7 #include "base/memory/weak_ptr.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/prefs/pref_registry_simple.h" 10 #include "base/prefs/pref_registry_simple.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 PrefService* prefs, 116 PrefService* prefs,
117 bool interactive_flow_required) 117 bool interactive_flow_required)
118 : ConfirmInfoBarDelegate(infobar_service), 118 : ConfirmInfoBarDelegate(infobar_service),
119 prefs_(prefs), 119 prefs_(prefs),
120 action_taken_(false), 120 action_taken_(false),
121 should_expire_(false), 121 should_expire_(false),
122 interactive_flow_required_(interactive_flow_required), 122 interactive_flow_required_(interactive_flow_required),
123 weak_factory_(this) { 123 weak_factory_(this) {
124 // We want the info-bar to stick-around for few seconds and then be hidden 124 // We want the info-bar to stick-around for few seconds and then be hidden
125 // on the next navigation after that. 125 // on the next navigation after that.
126 MessageLoop::current()->PostDelayedTask( 126 base::MessageLoop::current()->PostDelayedTask(
127 FROM_HERE, base::Bind(&DefaultBrowserInfoBarDelegate::AllowExpiry, 127 FROM_HERE,
128 weak_factory_.GetWeakPtr()), 128 base::Bind(&DefaultBrowserInfoBarDelegate::AllowExpiry,
129 weak_factory_.GetWeakPtr()),
129 base::TimeDelta::FromSeconds(8)); 130 base::TimeDelta::FromSeconds(8));
130 } 131 }
131 132
132 DefaultBrowserInfoBarDelegate::~DefaultBrowserInfoBarDelegate() { 133 DefaultBrowserInfoBarDelegate::~DefaultBrowserInfoBarDelegate() {
133 if (!action_taken_) 134 if (!action_taken_)
134 UMA_HISTOGRAM_COUNTS("DefaultBrowserWarning.Ignored", 1); 135 UMA_HISTOGRAM_COUNTS("DefaultBrowserWarning.Ignored", 1);
135 } 136 }
136 137
137 gfx::Image* DefaultBrowserInfoBarDelegate::GetIcon() const { 138 gfx::Image* DefaultBrowserInfoBarDelegate::GetIcon() const {
138 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( 139 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed(
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 264
264 } 265 }
265 266
266 #if !defined(OS_WIN) 267 #if !defined(OS_WIN)
267 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { 268 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) {
268 return false; 269 return false;
269 } 270 }
270 #endif 271 #endif
271 272
272 } // namespace chrome 273 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/startup/autolaunch_prompt_win.cc ('k') | chrome/browser/ui/startup/startup_browser_creator_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698