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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 navigator:show_params->GetParentWebContents() | 48 navigator:show_params->GetParentWebContents() |
49 delegate:this | 49 delegate:this |
50 prompt:prompt]); | 50 prompt:prompt]); |
51 | 51 |
52 base::scoped_nsobject<NSWindow> window([[ConstrainedWindowCustomWindow alloc] | 52 base::scoped_nsobject<NSWindow> window([[ConstrainedWindowCustomWindow alloc] |
53 initWithContentRect:[[view_controller_ view] bounds]]); | 53 initWithContentRect:[[view_controller_ view] bounds]]); |
54 [[window contentView] addSubview:[view_controller_ view]]; | 54 [[window contentView] addSubview:[view_controller_ view]]; |
55 | 55 |
56 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( | 56 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( |
57 [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:window]); | 57 [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:window]); |
58 constrained_window_.reset(new ConstrainedWindowMac( | 58 constrained_window_.reset(CreateAndShowWebModalDialogMac( |
59 this, show_params->GetParentWebContents(), sheet)); | 59 this, show_params->GetParentWebContents(), sheet)); |
60 | 60 |
61 std::string event_name = ExperienceSamplingEvent::kExtensionInstallDialog; | 61 std::string event_name = ExperienceSamplingEvent::kExtensionInstallDialog; |
62 event_name.append(ExtensionInstallPrompt::PromptTypeToString(prompt->type())); | 62 event_name.append(ExtensionInstallPrompt::PromptTypeToString(prompt->type())); |
63 sampling_event_ = ExperienceSamplingEvent::Create(event_name); | 63 sampling_event_ = ExperienceSamplingEvent::Create(event_name); |
64 } | 64 } |
65 | 65 |
66 ExtensionInstallDialogController::~ExtensionInstallDialogController() { | 66 ExtensionInstallDialogController::~ExtensionInstallDialogController() { |
67 } | 67 } |
68 | 68 |
(...skipping 18 matching lines...) Expand all Loading... |
87 if (delegate_) | 87 if (delegate_) |
88 delegate_->InstallUIAbort(false); | 88 delegate_->InstallUIAbort(false); |
89 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 89 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
90 } | 90 } |
91 | 91 |
92 // static | 92 // static |
93 ExtensionInstallPrompt::ShowDialogCallback | 93 ExtensionInstallPrompt::ShowDialogCallback |
94 ExtensionInstallPrompt::GetDefaultShowDialogCallback() { | 94 ExtensionInstallPrompt::GetDefaultShowDialogCallback() { |
95 return base::Bind(&ShowExtensionInstallDialogImpl); | 95 return base::Bind(&ShowExtensionInstallDialogImpl); |
96 } | 96 } |
OLD | NEW |