OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/profiles/profile_chooser_controller.h" | 5 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #import "base/mac/foundation_util.h" | 8 #import "base/mac/foundation_util.h" |
9 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 controller_.reset(); | 64 controller_.reset(); |
65 CocoaProfileTest::TearDown(); | 65 CocoaProfileTest::TearDown(); |
66 } | 66 } |
67 | 67 |
68 void StartProfileChooserController() { | 68 void StartProfileChooserController() { |
69 NSRect frame = [test_window() frame]; | 69 NSRect frame = [test_window() frame]; |
70 NSPoint point = NSMakePoint(NSMidX(frame), NSMidY(frame)); | 70 NSPoint point = NSMakePoint(NSMidX(frame), NSMidY(frame)); |
71 controller_.reset([[ProfileChooserController alloc] | 71 controller_.reset([[ProfileChooserController alloc] |
72 initWithBrowser:browser() | 72 initWithBrowser:browser() |
73 anchoredAt:point | 73 anchoredAt:point |
74 withMode:profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER | 74 viewMode:profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER |
75 withServiceType:signin::GAIA_SERVICE_TYPE_NONE]); | 75 tutorialMode:profiles::TUTORIAL_MODE_NONE |
| 76 serviceType:signin::GAIA_SERVICE_TYPE_NONE]); |
76 [controller_ showWindow:nil]; | 77 [controller_ showWindow:nil]; |
77 } | 78 } |
78 | 79 |
79 void EnableFastUserSwitching() { | 80 void EnableFastUserSwitching() { |
80 CommandLine::ForCurrentProcess()->AppendSwitch( | 81 CommandLine::ForCurrentProcess()->AppendSwitch( |
81 switches::kFastUserSwitching); | 82 switches::kFastUserSwitching); |
82 } | 83 } |
83 | 84 |
84 ProfileChooserController* controller() { return controller_; } | 85 ProfileChooserController* controller() { return controller_; } |
85 AvatarMenu* menu() { return menu_; } | 86 AvatarMenu* menu() { return menu_; } |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 [base::mac::ObjCCast<NSButton>(activeProfileName) title])); | 444 [base::mac::ObjCCast<NSButton>(activeProfileName) title])); |
444 | 445 |
445 // Profile links. This is a local profile, so there should be a signin button. | 446 // Profile links. This is a local profile, so there should be a signin button. |
446 NSArray* linksSubviews = [[activeCardSubviews objectAtIndex:0] subviews]; | 447 NSArray* linksSubviews = [[activeCardSubviews objectAtIndex:0] subviews]; |
447 ASSERT_EQ(1U, [linksSubviews count]); | 448 ASSERT_EQ(1U, [linksSubviews count]); |
448 NSButton* link = base::mac::ObjCCast<NSButton>( | 449 NSButton* link = base::mac::ObjCCast<NSButton>( |
449 [linksSubviews objectAtIndex:0]); | 450 [linksSubviews objectAtIndex:0]); |
450 EXPECT_EQ(@selector(hideAccountManagement:), [link action]); | 451 EXPECT_EQ(@selector(hideAccountManagement:), [link action]); |
451 EXPECT_EQ(controller(), [link target]); | 452 EXPECT_EQ(controller(), [link target]); |
452 } | 453 } |
OLD | NEW |