| 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 #include "chrome/browser/ui/cocoa/passwords/passwords_bubble_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/passwords/passwords_bubble_cocoa.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 ManagePasswordsBubbleCocoa::instance()->Close(); | 90 ManagePasswordsBubbleCocoa::instance()->Close(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 NSWindow* bubbleWindow() { | 93 NSWindow* bubbleWindow() { |
| 94 ManagePasswordsBubbleCocoa* bubble = ManagePasswordsBubbleCocoa::instance(); | 94 ManagePasswordsBubbleCocoa* bubble = ManagePasswordsBubbleCocoa::instance(); |
| 95 return bubble ? [bubble->controller_ window] : nil; | 95 return bubble ? [bubble->controller_ window] : nil; |
| 96 } | 96 } |
| 97 | 97 |
| 98 ManagePasswordsUIControllerMock* UIController() { | 98 ManagePasswordsUIControllerMock* UIController() { |
| 99 return static_cast<ManagePasswordsUIControllerMock*>( | 99 return static_cast<ManagePasswordsUIControllerMock*>( |
| 100 PasswordsModelDelegateFromWebContents(test_web_contents_)); | 100 ManagePasswordsUIController::FromWebContents(test_web_contents_)); |
| 101 } | 101 } |
| 102 | 102 |
| 103 ManagePasswordsBubbleController* controller() { | 103 ManagePasswordsBubbleController* controller() { |
| 104 ManagePasswordsBubbleCocoa* bubble = ManagePasswordsBubbleCocoa::instance(); | 104 ManagePasswordsBubbleCocoa* bubble = ManagePasswordsBubbleCocoa::instance(); |
| 105 return bubble ? bubble->controller_ : nil; | 105 return bubble ? bubble->controller_ : nil; |
| 106 } | 106 } |
| 107 | 107 |
| 108 ManagePasswordsIconCocoa* icon() { | 108 ManagePasswordsIconCocoa* icon() { |
| 109 return static_cast<ManagePasswordsIconCocoa*>( | 109 return static_cast<ManagePasswordsIconCocoa*>( |
| 110 ManagePasswordsBubbleCocoa::instance()->icon_); | 110 ManagePasswordsBubbleCocoa::instance()->icon_); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 EXPECT_FALSE([controller() shouldOpenAsKeyWindow]); | 194 EXPECT_FALSE([controller() shouldOpenAsKeyWindow]); |
| 195 EXPECT_FALSE([bubbleWindow() defaultButtonCell]); | 195 EXPECT_FALSE([bubbleWindow() defaultButtonCell]); |
| 196 } | 196 } |
| 197 | 197 |
| 198 TEST_F(ManagePasswordsBubbleCocoaTest, OpenWithFocus) { | 198 TEST_F(ManagePasswordsBubbleCocoaTest, OpenWithFocus) { |
| 199 ShowBubble(true); | 199 ShowBubble(true); |
| 200 EXPECT_TRUE(ManagePasswordsBubbleCocoa::instance()); | 200 EXPECT_TRUE(ManagePasswordsBubbleCocoa::instance()); |
| 201 EXPECT_TRUE([controller() shouldOpenAsKeyWindow]); | 201 EXPECT_TRUE([controller() shouldOpenAsKeyWindow]); |
| 202 EXPECT_TRUE([bubbleWindow() defaultButtonCell]); | 202 EXPECT_TRUE([bubbleWindow() defaultButtonCell]); |
| 203 } | 203 } |
| OLD | NEW |