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 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 controller_.reset(); | 63 controller_.reset(); |
64 CocoaProfileTest::TearDown(); | 64 CocoaProfileTest::TearDown(); |
65 } | 65 } |
66 | 66 |
67 void StartProfileChooserController() { | 67 void StartProfileChooserController() { |
68 NSRect frame = [test_window() frame]; | 68 NSRect frame = [test_window() frame]; |
69 NSPoint point = NSMakePoint(NSMidX(frame), NSMidY(frame)); | 69 NSPoint point = NSMakePoint(NSMidX(frame), NSMidY(frame)); |
70 controller_.reset([[ProfileChooserController alloc] | 70 controller_.reset([[ProfileChooserController alloc] |
71 initWithBrowser:browser() | 71 initWithBrowser:browser() |
72 anchoredAt:point | 72 anchoredAt:point |
73 withMode:profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER | 73 withViewMode:profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER |
| 74 withTutorialMode:profiles::TUTORIAL_MODE_NONE |
74 withServiceType:signin::GAIA_SERVICE_TYPE_NONE]); | 75 withServiceType:signin::GAIA_SERVICE_TYPE_NONE]); |
75 [controller_ showWindow:nil]; | 76 [controller_ showWindow:nil]; |
76 } | 77 } |
77 | 78 |
78 void EnableFastUserSwitching() { | 79 void EnableFastUserSwitching() { |
79 CommandLine::ForCurrentProcess()->AppendSwitch( | 80 CommandLine::ForCurrentProcess()->AppendSwitch( |
80 switches::kFastUserSwitching); | 81 switches::kFastUserSwitching); |
81 } | 82 } |
82 | 83 |
83 ProfileChooserController* controller() { return controller_; } | 84 ProfileChooserController* controller() { return controller_; } |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 EXPECT_EQ(menu()->GetItemAt(0).name, base::SysNSStringToUTF16( | 436 EXPECT_EQ(menu()->GetItemAt(0).name, base::SysNSStringToUTF16( |
436 [static_cast<NSButton*>(activeProfileName) title])); | 437 [static_cast<NSButton*>(activeProfileName) title])); |
437 | 438 |
438 // Profile links. This is a local profile, so there should be a signin button. | 439 // Profile links. This is a local profile, so there should be a signin button. |
439 NSArray* linksSubviews = [[activeCardSubviews objectAtIndex:0] subviews]; | 440 NSArray* linksSubviews = [[activeCardSubviews objectAtIndex:0] subviews]; |
440 ASSERT_EQ(1U, [linksSubviews count]); | 441 ASSERT_EQ(1U, [linksSubviews count]); |
441 NSButton* link = static_cast<NSButton*>([linksSubviews objectAtIndex:0]); | 442 NSButton* link = static_cast<NSButton*>([linksSubviews objectAtIndex:0]); |
442 EXPECT_EQ(@selector(hideAccountManagement:), [link action]); | 443 EXPECT_EQ(@selector(hideAccountManagement:), [link action]); |
443 EXPECT_EQ(controller(), [link target]); | 444 EXPECT_EQ(controller(), [link target]); |
444 } | 445 } |
OLD | NEW |