| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/login_handler_cocoa.h" | 5 #import "chrome/browser/ui/cocoa/login_handler_cocoa.h" |
| 6 | 6 |
| 7 #include "base/mac/bundle_locations.h" | 7 #include "base/mac/bundle_locations.h" |
| 8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 ~LoginHandlerMac() override { | 119 ~LoginHandlerMac() override { |
| 120 // This class will be deleted on a non UI thread. Ensure that the UI members | 120 // This class will be deleted on a non UI thread. Ensure that the UI members |
| 121 // have already been deleted. | 121 // have already been deleted. |
| 122 CHECK(!constrained_window_.get()); | 122 CHECK(!constrained_window_.get()); |
| 123 CHECK(!sheet_controller_.get()); | 123 CHECK(!sheet_controller_.get()); |
| 124 } | 124 } |
| 125 | 125 |
| 126 // The Cocoa controller of the GUI. | 126 // The Cocoa controller of the GUI. |
| 127 base::scoped_nsobject<LoginHandlerSheet> sheet_controller_; | 127 base::scoped_nsobject<LoginHandlerSheet> sheet_controller_; |
| 128 | 128 |
| 129 scoped_ptr<ConstrainedWindowMac> constrained_window_; | 129 std::unique_ptr<ConstrainedWindowMac> constrained_window_; |
| 130 | 130 |
| 131 DISALLOW_COPY_AND_ASSIGN(LoginHandlerMac); | 131 DISALLOW_COPY_AND_ASSIGN(LoginHandlerMac); |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 // static | 134 // static |
| 135 LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, | 135 LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, |
| 136 net::URLRequest* request) { | 136 net::URLRequest* request) { |
| 137 if (chrome::ToolkitViewsDialogsEnabled()) | 137 if (chrome::ToolkitViewsDialogsEnabled()) |
| 138 return chrome::CreateLoginHandlerViews(auth_info, request); | 138 return chrome::CreateLoginHandlerViews(auth_info, request); |
| 139 return new LoginHandlerMac(auth_info, request); | 139 return new LoginHandlerMac(auth_info, request); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 // Resize the text field. | 201 // Resize the text field. |
| 202 CGFloat windowDelta = [GTMUILocalizerAndLayoutTweaker | 202 CGFloat windowDelta = [GTMUILocalizerAndLayoutTweaker |
| 203 sizeToFitFixedWidthTextField:explanationField_]; | 203 sizeToFitFixedWidthTextField:explanationField_]; |
| 204 | 204 |
| 205 NSRect newFrame = [[self window] frame]; | 205 NSRect newFrame = [[self window] frame]; |
| 206 newFrame.size.height += windowDelta; | 206 newFrame.size.height += windowDelta; |
| 207 [[self window] setFrame:newFrame display:NO]; | 207 [[self window] setFrame:newFrame display:NO]; |
| 208 } | 208 } |
| 209 | 209 |
| 210 @end | 210 @end |
| OLD | NEW |