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

Side by Side Diff: chrome/browser/ui/cocoa/keystone_infobar_delegate.mm

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/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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 KeystonePromotionInfoBarDelegate::KeystonePromotionInfoBarDelegate( 95 KeystonePromotionInfoBarDelegate::KeystonePromotionInfoBarDelegate(
96 InfoBarService* infobar_service, 96 InfoBarService* infobar_service,
97 PrefService* prefs) 97 PrefService* prefs)
98 : ConfirmInfoBarDelegate(infobar_service), 98 : ConfirmInfoBarDelegate(infobar_service),
99 prefs_(prefs), 99 prefs_(prefs),
100 can_expire_(false), 100 can_expire_(false),
101 weak_ptr_factory_(this) { 101 weak_ptr_factory_(this) {
102 const base::TimeDelta kCanExpireOnNavigationAfterDelay = 102 const base::TimeDelta kCanExpireOnNavigationAfterDelay =
103 base::TimeDelta::FromSeconds(8); 103 base::TimeDelta::FromSeconds(8);
104 MessageLoop::current()->PostDelayedTask(FROM_HERE, 104 base::MessageLoop::current()->PostDelayedTask(FROM_HERE,
105 base::Bind(&KeystonePromotionInfoBarDelegate::SetCanExpire, 105 base::Bind(&KeystonePromotionInfoBarDelegate::SetCanExpire,
106 weak_ptr_factory_.GetWeakPtr()), 106 weak_ptr_factory_.GetWeakPtr()),
107 kCanExpireOnNavigationAfterDelay); 107 kCanExpireOnNavigationAfterDelay);
108 } 108 }
109 109
110 KeystonePromotionInfoBarDelegate::~KeystonePromotionInfoBarDelegate() { 110 KeystonePromotionInfoBarDelegate::~KeystonePromotionInfoBarDelegate() {
111 } 111 }
112 112
113 gfx::Image* KeystonePromotionInfoBarDelegate::GetIcon() const { 113 gfx::Image* KeystonePromotionInfoBarDelegate::GetIcon() const {
114 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( 114 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed(
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 224
225 @end // @implementation KeystonePromotionInfoBar 225 @end // @implementation KeystonePromotionInfoBar
226 226
227 // static 227 // static
228 void KeystoneInfoBar::PromotionInfoBar(Profile* profile) { 228 void KeystoneInfoBar::PromotionInfoBar(Profile* profile) {
229 KeystonePromotionInfoBar* promotionInfoBar = 229 KeystonePromotionInfoBar* promotionInfoBar =
230 [[[KeystonePromotionInfoBar alloc] init] autorelease]; 230 [[[KeystonePromotionInfoBar alloc] init] autorelease];
231 231
232 [promotionInfoBar checkAndShowInfoBarForProfile:profile]; 232 [promotionInfoBar checkAndShowInfoBarForProfile:profile];
233 } 233 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698