| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 6 | 6 |
| 7 #include <memory> |
| 8 |
| 7 #include "base/mac/mac_util.h" | 9 #include "base/mac/mac_util.h" |
| 8 #import "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "chrome/app/chrome_command_ids.h" | 11 #include "chrome/app/chrome_command_ids.h" |
| 11 #include "chrome/browser/chrome_notification_types.h" | 12 #include "chrome/browser/chrome_notification_types.h" |
| 12 #include "chrome/browser/ui/browser_list.h" | 13 #include "chrome/browser/ui/browser_list.h" |
| 13 #include "chrome/browser/ui/browser_window.h" | 14 #include "chrome/browser/ui/browser_window.h" |
| 14 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" | 15 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" |
| 15 #import "chrome/browser/ui/cocoa/fast_resize_view.h" | 16 #import "chrome/browser/ui/cocoa/fast_resize_view.h" |
| 16 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" | 17 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" |
| 17 #include "chrome/browser/ui/cocoa/run_loop_testing.h" | 18 #include "chrome/browser/ui/cocoa/run_loop_testing.h" |
| 18 #include "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" | 19 #include "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" |
| 19 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" | 20 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 bounds = browser_window->GetBounds(); | 222 bounds = browser_window->GetBounds(); |
| 222 EXPECT_EQ(272, bounds.height()); | 223 EXPECT_EQ(272, bounds.height()); |
| 223 | 224 |
| 224 [controller close]; | 225 [controller close]; |
| 225 } | 226 } |
| 226 | 227 |
| 227 #if 0 | 228 #if 0 |
| 228 // TODO(jrg): This crashes trying to create the BookmarkBarController, adding | 229 // TODO(jrg): This crashes trying to create the BookmarkBarController, adding |
| 229 // an observer to the BookmarkModel. | 230 // an observer to the BookmarkModel. |
| 230 TEST_F(BrowserWindowControllerTest, TestIncognitoWidthSpace) { | 231 TEST_F(BrowserWindowControllerTest, TestIncognitoWidthSpace) { |
| 231 scoped_ptr<TestingProfile> incognito_profile(new TestingProfile()); | 232 std::unique_ptr<TestingProfile> incognito_profile(new TestingProfile()); |
| 232 incognito_profile->set_off_the_record(true); | 233 incognito_profile->set_off_the_record(true); |
| 233 scoped_ptr<Browser> browser( | 234 std::unique_ptr<Browser> browser( |
| 234 new Browser(Browser::CreateParams(incognito_profile.get()))); | 235 new Browser(Browser::CreateParams(incognito_profile.get()))); |
| 235 controller_.reset([[BrowserWindowController alloc] | 236 controller_.reset([[BrowserWindowController alloc] |
| 236 initWithBrowser:browser.get() | 237 initWithBrowser:browser.get() |
| 237 takeOwnership:NO]); | 238 takeOwnership:NO]); |
| 238 | 239 |
| 239 NSRect tabFrame = [[controller_ tabStripView] frame]; | 240 NSRect tabFrame = [[controller_ tabStripView] frame]; |
| 240 [controller_ installIncognitoBadge]; | 241 [controller_ installIncognitoBadge]; |
| 241 NSRect newTabFrame = [[controller_ tabStripView] frame]; | 242 NSRect newTabFrame = [[controller_ tabStripView] frame]; |
| 242 EXPECT_GT(tabFrame.size.width, newTabFrame.size.width); | 243 EXPECT_GT(tabFrame.size.width, newTabFrame.size.width); |
| 243 | 244 |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,400,400) | 813 [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,400,400) |
| 813 styleMask:NSBorderlessWindowMask | 814 styleMask:NSBorderlessWindowMask |
| 814 backing:NSBackingStoreBuffered | 815 backing:NSBackingStoreBuffered |
| 815 defer:NO]); | 816 defer:NO]); |
| 816 [[testFullscreenWindow_ contentView] setWantsLayer:YES]; | 817 [[testFullscreenWindow_ contentView] setWantsLayer:YES]; |
| 817 return testFullscreenWindow_.get(); | 818 return testFullscreenWindow_.get(); |
| 818 } | 819 } |
| 819 @end | 820 @end |
| 820 | 821 |
| 821 /* TODO(???): test other methods of BrowserWindowController */ | 822 /* TODO(???): test other methods of BrowserWindowController */ |
| OLD | NEW |