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

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

Issue 23338005: Mac InfoBar: Use cross platform infobar classes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 7 years, 4 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/alternate_nav_infobar_controller.mm
diff --git a/chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.mm
index a8b784d2c18b7cdc48155c3155d010fc10b840e3..9d64080b131da9c27a40b204527517936294ee8b 100644
--- a/chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.mm
+++ b/chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.mm
@@ -7,7 +7,7 @@
#include "base/logging.h"
#include "base/strings/sys_string_conversions.h"
#import "chrome/browser/ui/cocoa/hyperlink_text_view.h"
-#include "chrome/browser/ui/cocoa/infobars/infobar.h"
+#include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h"
#include "chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.h"
#import "ui/base/cocoa/cocoa_event_utils.h"
#include "ui/base/window_open_disposition.h"
@@ -25,7 +25,7 @@
[self removeButtons];
AlternateNavInfoBarDelegate* delegate =
- static_cast<AlternateNavInfoBarDelegate*>(delegate_);
+ static_cast<AlternateNavInfoBarDelegate*>([self delegate]);
DCHECK(delegate);
size_t offset = string16::npos;
string16 message = delegate->GetMessageTextWithOffset(&offset);
@@ -50,7 +50,7 @@
WindowOpenDisposition disposition =
ui::WindowOpenDispositionFromNSEvent([NSApp currentEvent]);
AlternateNavInfoBarDelegate* delegate =
- static_cast<AlternateNavInfoBarDelegate*>(delegate_);
+ static_cast<AlternateNavInfoBarDelegate*>([self delegate]);
if (delegate->LinkClicked(disposition))
[self removeSelf];
}
@@ -58,7 +58,9 @@
@end
InfoBar* AlternateNavInfoBarDelegate::CreateInfoBar(InfoBarService* owner) {
- AlternateNavInfoBarController* controller =
- [[AlternateNavInfoBarController alloc] initWithDelegate:this owner:owner];
- return new InfoBar(controller, this);
+ scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(owner, this));
Robert Sesek 2013/08/26 19:35:02 Shouldn't this be info_bar? And the files too, sin
Peter Kasting 2013/08/26 19:38:44 It is a fair point. The rest of the infobar code
+ base::scoped_nsobject<AlternateNavInfoBarController> controller(
+ [[AlternateNavInfoBarController alloc] initWithInfoBar:infobar.get()]);
+ infobar->set_controller(controller);
+ return infobar.release();
}

Powered by Google App Engine
This is Rietveld 408576698