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 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
6 | 6 |
7 #import "base/mac/mac_util.h" | 7 #import "base/mac/mac_util.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
11 #include "chrome/browser/devtools/devtools_window.h" | 11 #include "chrome/browser/devtools/devtools_window.h" |
12 #include "chrome/browser/infobars/infobar_service.h" | 12 #include "chrome/browser/infobars/infobar_service.h" |
13 #include "chrome/browser/infobars/simple_alert_infobar_delegate.h" | 13 #include "chrome/browser/infobars/simple_alert_infobar_delegate.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/profiles/profile_manager.h" | 15 #include "chrome/browser/profiles/profile_manager.h" |
16 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" | 16 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
17 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
18 #include "chrome/browser/ui/browser_commands.h" | 18 #include "chrome/browser/ui/browser_commands.h" |
19 #include "chrome/browser/ui/browser_list.h" | 19 #include "chrome/browser/ui/browser_list.h" |
20 #include "chrome/browser/ui/browser_window.h" | 20 #include "chrome/browser/ui/browser_window.h" |
21 #import "chrome/browser/ui/cocoa/browser/avatar_button_controller.h" | 21 #import "chrome/browser/ui/cocoa/browser/avatar_base_controller.h" |
22 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" | 22 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" |
23 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" | 23 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" |
24 #import "chrome/browser/ui/cocoa/fast_resize_view.h" | 24 #import "chrome/browser/ui/cocoa/fast_resize_view.h" |
25 #import "chrome/browser/ui/cocoa/history_overlay_controller.h" | 25 #import "chrome/browser/ui/cocoa/history_overlay_controller.h" |
26 #import "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h" | 26 #import "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h" |
27 #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h" | 27 #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h" |
28 #import "chrome/browser/ui/cocoa/nsview_additions.h" | 28 #import "chrome/browser/ui/cocoa/nsview_additions.h" |
29 #import "chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.h" | 29 #import "chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.h" |
30 #include "chrome/browser/ui/extensions/application_launch.h" | 30 #include "chrome/browser/ui/extensions/application_launch.h" |
31 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 31 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 168 |
169 // With only one profile, the fullscreen button should be visible, but the | 169 // With only one profile, the fullscreen button should be visible, but the |
170 // avatar button should not. | 170 // avatar button should not. |
171 EXPECT_EQ(1u, profile_manager->GetNumberOfProfiles()); | 171 EXPECT_EQ(1u, profile_manager->GetNumberOfProfiles()); |
172 | 172 |
173 NSButton* fullscreen_button = | 173 NSButton* fullscreen_button = |
174 [window standardWindowButton:NSWindowFullScreenButton]; | 174 [window standardWindowButton:NSWindowFullScreenButton]; |
175 EXPECT_TRUE(fullscreen_button); | 175 EXPECT_TRUE(fullscreen_button); |
176 EXPECT_FALSE([fullscreen_button isHidden]); | 176 EXPECT_FALSE([fullscreen_button isHidden]); |
177 | 177 |
178 AvatarButtonController* avatar_controller = | 178 AvatarBaseController* avatar_controller = |
179 [controller() avatarButtonController]; | 179 [controller() avatarButtonController]; |
180 NSView* avatar = [avatar_controller view]; | 180 NSView* avatar = [avatar_controller view]; |
181 EXPECT_TRUE(avatar); | 181 EXPECT_TRUE(avatar); |
182 EXPECT_TRUE([avatar isHidden]); | 182 EXPECT_TRUE([avatar isHidden]); |
183 | 183 |
184 // Create a profile asynchronously and run the loop until its creation | 184 // Create a profile asynchronously and run the loop until its creation |
185 // is complete. | 185 // is complete. |
186 base::RunLoop run_loop; | 186 base::RunLoop run_loop; |
187 | 187 |
188 ProfileManager::CreateCallback create_callback = | 188 ProfileManager::CreateCallback create_callback = |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 StatusBubblePositioning) { | 378 StatusBubblePositioning) { |
379 NSPoint origin = [controller() statusBubbleBaseFrame].origin; | 379 NSPoint origin = [controller() statusBubbleBaseFrame].origin; |
380 | 380 |
381 DevToolsWindow* devtools_window = DevToolsWindow::OpenDevToolsWindowForTest( | 381 DevToolsWindow* devtools_window = DevToolsWindow::OpenDevToolsWindowForTest( |
382 browser(), true); | 382 browser(), true); |
383 SetDevToolsWindowContentsInsets(devtools_window, 10, 10, 10, 10); | 383 SetDevToolsWindowContentsInsets(devtools_window, 10, 10, 10, 10); |
384 | 384 |
385 NSPoint originWithDevTools = [controller() statusBubbleBaseFrame].origin; | 385 NSPoint originWithDevTools = [controller() statusBubbleBaseFrame].origin; |
386 EXPECT_FALSE(NSEqualPoints(origin, originWithDevTools)); | 386 EXPECT_FALSE(NSEqualPoints(origin, originWithDevTools)); |
387 } | 387 } |
OLD | NEW |