| 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/website_settings/website_settings_bubble_contro
ller.h" | 5 #import "chrome/browser/ui/cocoa/website_settings/website_settings_bubble_contro
ller.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 8 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
| 9 #include "testing/gtest_mac.h" | 9 #include "testing/gtest_mac.h" |
| 10 | 10 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 WebsiteSettingsUIBridge* bridge_; // Weak, owned by controller. | 142 WebsiteSettingsUIBridge* bridge_; // Weak, owned by controller. |
| 143 | 143 |
| 144 enum MatchType { | 144 enum MatchType { |
| 145 TEXT_EQUAL = 0, | 145 TEXT_EQUAL = 0, |
| 146 TEXT_NOT_EQUAL | 146 TEXT_NOT_EQUAL |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 // Creates a new website settings bubble, with the given default width. | 149 // Creates a new website settings bubble, with the given default width. |
| 150 // If |default_width| is 0, the *default* default width will be used. | 150 // If |default_width| is 0, the *default* default width will be used. |
| 151 void CreateBubbleWithWidth(CGFloat default_width) { | 151 void CreateBubbleWithWidth(CGFloat default_width) { |
| 152 bridge_ = new WebsiteSettingsUIBridge(); | 152 bridge_ = new WebsiteSettingsUIBridge(nullptr); |
| 153 | 153 |
| 154 // The controller cleans up after itself when the window closes. | 154 // The controller cleans up after itself when the window closes. |
| 155 controller_ = [WebsiteSettingsBubbleControllerForTesting alloc]; | 155 controller_ = [WebsiteSettingsBubbleControllerForTesting alloc]; |
| 156 [controller_ setDefaultWindowWidth:default_width]; | 156 [controller_ setDefaultWindowWidth:default_width]; |
| 157 [controller_ initWithParentWindow:test_window() | 157 [controller_ initWithParentWindow:test_window() |
| 158 websiteSettingsUIBridge:bridge_ | 158 websiteSettingsUIBridge:bridge_ |
| 159 webContents:nil | 159 webContents:nil |
| 160 isInternalPage:NO]; | 160 isInternalPage:NO]; |
| 161 window_ = [controller_ window]; | 161 window_ = [controller_ window]; |
| 162 [controller_ showWindow:nil]; | 162 [controller_ showWindow:nil]; |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 // popup buttons. | 379 // popup buttons. |
| 380 for (NSView* view in [[controller_ permissionsView] subviews]) { | 380 for (NSView* view in [[controller_ permissionsView] subviews]) { |
| 381 if ([view isKindOfClass:[NSPopUpButton class]]) { | 381 if ([view isKindOfClass:[NSPopUpButton class]]) { |
| 382 NSPopUpButton* button = static_cast<NSPopUpButton*>(view); | 382 NSPopUpButton* button = static_cast<NSPopUpButton*>(view); |
| 383 EXPECT_LT(NSMaxX([button frame]), window_width); | 383 EXPECT_LT(NSMaxX([button frame]), window_width); |
| 384 } | 384 } |
| 385 } | 385 } |
| 386 } | 386 } |
| 387 | 387 |
| 388 } // namespace | 388 } // namespace |
| OLD | NEW |