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/profiles/user_manager_mac.h" | 5 #include "chrome/browser/ui/cocoa/profiles/user_manager_mac.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/mac/foundation_util.h" | 8 #include "base/mac/foundation_util.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #import "chrome/browser/app_controller_mac.h" | 10 #import "chrome/browser/app_controller_mac.h" |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 [window setMinSize:NSMakeSize(UserManager::kWindowWidth, | 309 [window setMinSize:NSMakeSize(UserManager::kWindowWidth, |
310 UserManager::kWindowHeight)]; | 310 UserManager::kWindowHeight)]; |
311 | 311 |
312 if ((self = [super initWithWindow:window])) { | 312 if ((self = [super initWithWindow:window])) { |
313 userManagerObserver_ = userManagerObserver; | 313 userManagerObserver_ = userManagerObserver; |
314 | 314 |
315 // Initialize the web view. | 315 // Initialize the web view. |
316 webContents_.reset(content::WebContents::Create( | 316 webContents_.reset(content::WebContents::Create( |
317 content::WebContents::CreateParams(profile))); | 317 content::WebContents::CreateParams(profile))); |
318 window.contentView = webContents_->GetNativeView(); | 318 window.contentView = webContents_->GetNativeView(); |
| 319 |
| 320 // When a window has layer-backed subviews, its contentView must be |
| 321 // layer-backed or it won't mask the subviews to its rounded corners. See |
| 322 // https://crbug.com/620049 |
| 323 // The static_cast is just needed for the 10.10 SDK. It can be removed when |
| 324 // we move to a newer one. |
| 325 static_cast<NSView*>(window.contentView).wantsLayer = YES; |
| 326 |
319 webContentsDelegate_.reset(new UserManagerWebContentsDelegate()); | 327 webContentsDelegate_.reset(new UserManagerWebContentsDelegate()); |
320 webContents_->SetDelegate(webContentsDelegate_.get()); | 328 webContents_->SetDelegate(webContentsDelegate_.get()); |
321 | 329 |
322 web_modal::WebContentsModalDialogManager::CreateForWebContents( | 330 web_modal::WebContentsModalDialogManager::CreateForWebContents( |
323 webContents_.get()); | 331 webContents_.get()); |
324 modal_manager_delegate_.reset( | 332 modal_manager_delegate_.reset( |
325 new UserManagerModalManagerDelegate([[self window] contentView])); | 333 new UserManagerModalManagerDelegate([[self window] contentView])); |
326 web_modal::WebContentsModalDialogManager::FromWebContents( | 334 web_modal::WebContentsModalDialogManager::FromWebContents( |
327 webContents_.get())->SetDelegate(modal_manager_delegate_.get()); | 335 webContents_.get())->SetDelegate(modal_manager_delegate_.get()); |
328 | 336 |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 [window_controller_ displayErrorMessage]; | 588 [window_controller_ displayErrorMessage]; |
581 } | 589 } |
582 | 590 |
583 void UserManagerMac::SetSigninProfilePath(const base::FilePath& profile_path) { | 591 void UserManagerMac::SetSigninProfilePath(const base::FilePath& profile_path) { |
584 signin_profile_path_ = profile_path; | 592 signin_profile_path_ = profile_path; |
585 } | 593 } |
586 | 594 |
587 base::FilePath UserManagerMac::GetSigninProfilePath() { | 595 base::FilePath UserManagerMac::GetSigninProfilePath() { |
588 return signin_profile_path_; | 596 return signin_profile_path_; |
589 } | 597 } |
OLD | NEW |