Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller_unittest.mm

Issue 2232453002: Show a custom message in the page info bubble for view-source URLs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: The Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // If |default_width| is 0, the *default* default width will be used. 124 // If |default_width| is 0, the *default* default width will be used.
125 void CreateBubbleWithWidth(CGFloat default_width) { 125 void CreateBubbleWithWidth(CGFloat default_width) {
126 bridge_ = new WebsiteSettingsUIBridge(nullptr); 126 bridge_ = new WebsiteSettingsUIBridge(nullptr);
127 127
128 // The controller cleans up after itself when the window closes. 128 // The controller cleans up after itself when the window closes.
129 controller_ = [WebsiteSettingsBubbleControllerForTesting alloc]; 129 controller_ = [WebsiteSettingsBubbleControllerForTesting alloc];
130 [controller_ setDefaultWindowWidth:default_width]; 130 [controller_ setDefaultWindowWidth:default_width];
131 [controller_ initWithParentWindow:test_window() 131 [controller_ initWithParentWindow:test_window()
132 websiteSettingsUIBridge:bridge_ 132 websiteSettingsUIBridge:bridge_
133 webContents:nil 133 webContents:nil
134 bubbleType:WEB_PAGE 134 url:GURL("https://www.google.com")
135 isDevToolsDisabled:NO]; 135 isDevToolsDisabled:NO];
136 window_ = [controller_ window]; 136 window_ = [controller_ window];
137 [controller_ showWindow:nil]; 137 [controller_ showWindow:nil];
138 } 138 }
139 139
140 void CreateBubble() { 140 void CreateBubble() {
141 CreateBubbleWithWidth(0.0); 141 CreateBubbleWithWidth(0.0);
142 } 142 }
143 143
144 // Return a pointer to the first NSTextField found that either matches, or 144 // Return a pointer to the first NSTextField found that either matches, or
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 } 344 }
345 if ([view isKindOfClass:[NSPopUpButton class]]) { 345 if ([view isKindOfClass:[NSPopUpButton class]]) {
346 NSPopUpButton* button = static_cast<NSPopUpButton*>(view); 346 NSPopUpButton* button = static_cast<NSPopUpButton*>(view);
347 EXPECT_LT(NSMaxX([button frame]), window_width); 347 EXPECT_LT(NSMaxX([button frame]), window_width);
348 } 348 }
349 } 349 }
350 } 350 }
351 } 351 }
352 352
353 } // namespace 353 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698