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

Unified Diff: chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm

Issue 22694006: Infobar system refactor. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm
===================================================================
--- chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm (revision 226624)
+++ chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm (working copy)
@@ -27,11 +27,13 @@
using InfoBarUtilities::CreateLabel;
using InfoBarUtilities::AddMenuItem;
-// TranslateInfoBarDelegate views specific method:
-InfoBar* TranslateInfoBarDelegate::CreateInfoBar(InfoBarService* owner) {
- scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(owner, this));
+// static
+scoped_ptr<InfoBar> TranslateInfoBarDelegate::CreateInfoBar(
+ scoped_ptr<TranslateInfoBarDelegate> delegate) {
+ scoped_ptr<InfoBarCocoa> infobar(
+ new InfoBarCocoa(delegate.PassAs<InfoBarDelegate>()));
base::scoped_nsobject<TranslateInfoBarControllerBase> infobar_controller;
- switch (infobar_type_) {
+ switch (infobar->delegate()->AsTranslateInfoBarDelegate()->infobar_type()) {
case BEFORE_TRANSLATE:
infobar_controller.reset([[BeforeTranslateInfobarController alloc]
initWithInfoBar:infobar.get()]);
@@ -49,7 +51,7 @@
NOTREACHED();
}
infobar->set_controller(infobar_controller);
- return infobar.release();
+ return infobar.PassAs<InfoBar>();
}
@implementation TranslateInfoBarControllerBase (FrameChangeObserver)

Powered by Google App Engine
This is Rietveld 408576698