Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "base/mac/mac_util.h" | 5 #include "base/mac/mac_util.h" |
| 6 #include "base/memory/scoped_nsobject.h" | 6 #include "base/memory/scoped_nsobject.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
| 10 #include "chrome/browser/sync/sync_ui_util.h" | 10 #include "chrome/browser/sync/sync_ui_util.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 [controller_ updateBookmarkBarVisibilityWithAnimation:NO]; | 110 [controller_ updateBookmarkBarVisibilityWithAnimation:NO]; |
| 111 | 111 |
| 112 // Make sure a normal BrowserWindowController is, uh, normal. | 112 // Make sure a normal BrowserWindowController is, uh, normal. |
| 113 EXPECT_TRUE([controller_ isTabbedWindow]); | 113 EXPECT_TRUE([controller_ isTabbedWindow]); |
| 114 EXPECT_TRUE([controller_ hasTabStrip]); | 114 EXPECT_TRUE([controller_ hasTabStrip]); |
| 115 EXPECT_FALSE([controller_ hasTitleBar]); | 115 EXPECT_FALSE([controller_ hasTitleBar]); |
| 116 EXPECT_TRUE([controller_ isBookmarkBarVisible]); | 116 EXPECT_TRUE([controller_ isBookmarkBarVisible]); |
| 117 | 117 |
| 118 // And make sure a controller for a pop-up window is not normal. | 118 // And make sure a controller for a pop-up window is not normal. |
| 119 // popup_browser will be owned by its window. | 119 // popup_browser will be owned by its window. |
| 120 Browser *popup_browser(Browser::CreateForType(Browser::TYPE_POPUP, | 120 Browser *popup_browser(Browser::CreateWithParams( |
|
Ben Goodger (Google)
2012/04/04 16:14:42
Browser* popup_browser
Aaron Boodman
2012/04/04 18:46:58
Done.
| |
| 121 profile())); | 121 Browser::CreateParams(Browser::TYPE_POPUP, profile()))); |
| 122 NSWindow *cocoaWindow = popup_browser->window()->GetNativeHandle(); | 122 NSWindow *cocoaWindow = popup_browser->window()->GetNativeHandle(); |
| 123 BrowserWindowController* controller = | 123 BrowserWindowController* controller = |
| 124 static_cast<BrowserWindowController*>([cocoaWindow windowController]); | 124 static_cast<BrowserWindowController*>([cocoaWindow windowController]); |
| 125 ASSERT_TRUE([controller isKindOfClass:[BrowserWindowController class]]); | 125 ASSERT_TRUE([controller isKindOfClass:[BrowserWindowController class]]); |
| 126 EXPECT_FALSE([controller isTabbedWindow]); | 126 EXPECT_FALSE([controller isTabbedWindow]); |
| 127 EXPECT_FALSE([controller hasTabStrip]); | 127 EXPECT_FALSE([controller hasTabStrip]); |
| 128 EXPECT_TRUE([controller hasTitleBar]); | 128 EXPECT_TRUE([controller hasTitleBar]); |
| 129 EXPECT_FALSE([controller isBookmarkBarVisible]); | 129 EXPECT_FALSE([controller isBookmarkBarVisible]); |
| 130 [controller close]; | 130 [controller close]; |
| 131 } | 131 } |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 712 testFullscreenWindow_.reset( | 712 testFullscreenWindow_.reset( |
| 713 [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,400,400) | 713 [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,400,400) |
| 714 styleMask:NSBorderlessWindowMask | 714 styleMask:NSBorderlessWindowMask |
| 715 backing:NSBackingStoreBuffered | 715 backing:NSBackingStoreBuffered |
| 716 defer:NO]); | 716 defer:NO]); |
| 717 return testFullscreenWindow_.get(); | 717 return testFullscreenWindow_.get(); |
| 718 } | 718 } |
| 719 @end | 719 @end |
| 720 | 720 |
| 721 /* TODO(???): test other methods of BrowserWindowController */ | 721 /* TODO(???): test other methods of BrowserWindowController */ |
| OLD | NEW |