Chromium Code Reviews| 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/extensions/extension_install_dialog_controller. h" | 5 #import "chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller. h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 navigator:show_params->GetParentWebContents() | 53 navigator:show_params->GetParentWebContents() |
| 54 delegate:this | 54 delegate:this |
| 55 prompt:std::move(prompt)]); | 55 prompt:std::move(prompt)]); |
| 56 | 56 |
| 57 base::scoped_nsobject<NSWindow> window([[ConstrainedWindowCustomWindow alloc] | 57 base::scoped_nsobject<NSWindow> window([[ConstrainedWindowCustomWindow alloc] |
| 58 initWithContentRect:[[view_controller_ view] bounds]]); | 58 initWithContentRect:[[view_controller_ view] bounds]]); |
| 59 [[window contentView] addSubview:[view_controller_ view]]; | 59 [[window contentView] addSubview:[view_controller_ view]]; |
| 60 | 60 |
| 61 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( | 61 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( |
| 62 [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:window]); | 62 [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:window]); |
| 63 [sheet setUseSimpleAnimations:YES]; | |
|
tapted
2016/03/15 00:39:40
nit: I guess it's somewhat redundant, but we shoul
erikchen
2016/03/15 00:52:25
Done.
| |
| 63 constrained_window_ = CreateAndShowWebModalDialogMac( | 64 constrained_window_ = CreateAndShowWebModalDialogMac( |
| 64 this, show_params->GetParentWebContents(), sheet); | 65 this, show_params->GetParentWebContents(), sheet); |
| 65 | 66 |
| 66 std::string event_name = ExperienceSamplingEvent::kExtensionInstallDialog; | 67 std::string event_name = ExperienceSamplingEvent::kExtensionInstallDialog; |
| 67 event_name.append( | 68 event_name.append( |
| 68 ExtensionInstallPrompt::PromptTypeToString(promptType)); | 69 ExtensionInstallPrompt::PromptTypeToString(promptType)); |
| 69 sampling_event_ = ExperienceSamplingEvent::Create(event_name); | 70 sampling_event_ = ExperienceSamplingEvent::Create(event_name); |
| 70 } | 71 } |
| 71 | 72 |
| 72 ExtensionInstallDialogController::~ExtensionInstallDialogController() { | 73 ExtensionInstallDialogController::~ExtensionInstallDialogController() { |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 103 sampling_event_->CreateUserDecisionEvent(decision_event); | 104 sampling_event_->CreateUserDecisionEvent(decision_event); |
| 104 base::ResetAndReturn(&done_callback_).Run(result); | 105 base::ResetAndReturn(&done_callback_).Run(result); |
| 105 constrained_window_->CloseWebContentsModalDialog(); | 106 constrained_window_->CloseWebContentsModalDialog(); |
| 106 } | 107 } |
| 107 | 108 |
| 108 // static | 109 // static |
| 109 ExtensionInstallPrompt::ShowDialogCallback | 110 ExtensionInstallPrompt::ShowDialogCallback |
| 110 ExtensionInstallPrompt::GetDefaultShowDialogCallback() { | 111 ExtensionInstallPrompt::GetDefaultShowDialogCallback() { |
| 111 return base::Bind(&ShowExtensionInstallDialogImpl); | 112 return base::Bind(&ShowExtensionInstallDialogImpl); |
| 112 } | 113 } |
| OLD | NEW |