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

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

Issue 23338005: Mac InfoBar: Use cross platform infobar classes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm
diff --git a/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm b/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm
index 2c03aca2f3954836981365d83020fd882ca6720e..ac93f1fe4cd43bbc7eb6284a6d2512a2af499f4e 100644
--- a/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm
+++ b/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm
@@ -13,7 +13,7 @@
#include "chrome/browser/translate/translate_language_list.h"
#include "chrome/browser/ui/cocoa/cocoa_profile_test.h"
#import "chrome/browser/ui/cocoa/infobars/before_translate_infobar_controller.h"
-#import "chrome/browser/ui/cocoa/infobars/infobar.h"
+#import "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h"
#import "chrome/browser/ui/cocoa/infobars/translate_infobar_base.h"
#import "content/public/browser/web_contents.h"
#include "ipc/ipc_message.h"
@@ -88,10 +88,14 @@ class TranslationInfoBarTest : public CocoaProfileTest {
infobar_delegate_.reset(new MockTranslateInfoBarDelegate(
infobar_service, type, error, profile->GetPrefs(), config));
[[infobar_controller_ view] removeFromSuperview];
- scoped_ptr<InfoBar> infobar(static_cast<InfoBarDelegate*>(
- infobar_delegate_.get())->CreateInfoBar(infobar_service));
- infobar_controller_.reset(reinterpret_cast<TranslateInfoBarControllerBase*>(
- infobar->controller()));
+
+ InfoBarDelegate* base =
+ static_cast<InfoBarDelegate*>(infobar_delegate_.get());
+ infobar_.reset(
+ static_cast<InfoBarCocoa*>(base->CreateInfoBar(infobar_service)));
+ infobar_controller_.reset([static_cast<TranslateInfoBarControllerBase*>(
+ infobar_->controller()) retain]);
+
// We need to set the window to be wide so that the options button
// doesn't overlap the other buttons.
[test_window() setContentSize:NSMakeSize(2000, 500)];
@@ -101,6 +105,7 @@ class TranslationInfoBarTest : public CocoaProfileTest {
scoped_ptr<WebContents> web_contents_;
scoped_ptr<MockTranslateInfoBarDelegate> infobar_delegate_;
+ scoped_ptr<InfoBarCocoa> infobar_;
base::scoped_nsobject<TranslateInfoBarControllerBase> infobar_controller_;
};
« no previous file with comments | « chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698