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

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

Issue 812823002: Remove dependency of infobars component on the embedder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix android compilation Created 6 years 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
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 void KeystonePromotionInfoBarDelegate::Create() { 74 void KeystonePromotionInfoBarDelegate::Create() {
75 Browser* browser = chrome::GetLastActiveBrowser(); 75 Browser* browser = chrome::GetLastActiveBrowser();
76 if (!browser) 76 if (!browser)
77 return; 77 return;
78 content::WebContents* webContents = 78 content::WebContents* webContents =
79 browser->tab_strip_model()->GetActiveWebContents(); 79 browser->tab_strip_model()->GetActiveWebContents();
80 if (!webContents) 80 if (!webContents)
81 return; 81 return;
82 InfoBarService* infobar_service = 82 InfoBarService* infobar_service =
83 InfoBarService::FromWebContents(webContents); 83 InfoBarService::FromWebContents(webContents);
84 infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( 84 infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar(
85 scoped_ptr<ConfirmInfoBarDelegate>(new KeystonePromotionInfoBarDelegate( 85 scoped_ptr<ConfirmInfoBarDelegate>(new KeystonePromotionInfoBarDelegate(
86 Profile::FromBrowserContext( 86 Profile::FromBrowserContext(webContents->GetBrowserContext())
87 webContents->GetBrowserContext())->GetPrefs())))); 87 ->GetPrefs()))));
Peter Kasting 2014/12/19 23:06:23 Nit: Old linebreaking here was better
sdefresne 2014/12/20 11:30:55 Sorry, I reformatted everything with clang-format
88 } 88 }
89 89
90 KeystonePromotionInfoBarDelegate::KeystonePromotionInfoBarDelegate( 90 KeystonePromotionInfoBarDelegate::KeystonePromotionInfoBarDelegate(
91 PrefService* prefs) 91 PrefService* prefs)
92 : ConfirmInfoBarDelegate(), 92 : ConfirmInfoBarDelegate(),
93 prefs_(prefs), 93 prefs_(prefs),
94 can_expire_(false), 94 can_expire_(false),
95 weak_ptr_factory_(this) { 95 weak_ptr_factory_(this) {
96 const base::TimeDelta kCanExpireOnNavigationAfterDelay = 96 const base::TimeDelta kCanExpireOnNavigationAfterDelay =
97 base::TimeDelta::FromSeconds(8); 97 base::TimeDelta::FromSeconds(8);
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 217
218 @end // @implementation KeystonePromotionInfoBar 218 @end // @implementation KeystonePromotionInfoBar
219 219
220 // static 220 // static
221 void KeystoneInfoBar::PromotionInfoBar(Profile* profile) { 221 void KeystoneInfoBar::PromotionInfoBar(Profile* profile) {
222 KeystonePromotionInfoBar* promotionInfoBar = 222 KeystonePromotionInfoBar* promotionInfoBar =
223 [[[KeystonePromotionInfoBar alloc] init] autorelease]; 223 [[[KeystonePromotionInfoBar alloc] init] autorelease];
224 224
225 [promotionInfoBar checkAndShowInfoBarForProfile:profile]; 225 [promotionInfoBar checkAndShowInfoBarForProfile:profile];
226 } 226 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698