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

Side by Side Diff: chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm

Issue 1446623003: [Reland] Enable AutoResize for Constrained Web Dialogs for Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 10 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 (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
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 constrained_window_.reset(new ConstrainedWindowMac( 63 constrained_window_ = CreateAndShowWebModalDialogMac(
64 this, show_params->GetParentWebContents(), sheet)); 64 this, show_params->GetParentWebContents(), sheet);
65 65
66 std::string event_name = ExperienceSamplingEvent::kExtensionInstallDialog; 66 std::string event_name = ExperienceSamplingEvent::kExtensionInstallDialog;
67 event_name.append( 67 event_name.append(
68 ExtensionInstallPrompt::PromptTypeToString(promptType)); 68 ExtensionInstallPrompt::PromptTypeToString(promptType));
69 sampling_event_ = ExperienceSamplingEvent::Create(event_name); 69 sampling_event_ = ExperienceSamplingEvent::Create(event_name);
70 } 70 }
71 71
72 ExtensionInstallDialogController::~ExtensionInstallDialogController() { 72 ExtensionInstallDialogController::~ExtensionInstallDialogController() {
73 } 73 }
74 74
(...skipping 28 matching lines...) Expand all
103 sampling_event_->CreateUserDecisionEvent(decision_event); 103 sampling_event_->CreateUserDecisionEvent(decision_event);
104 base::ResetAndReturn(&done_callback_).Run(result); 104 base::ResetAndReturn(&done_callback_).Run(result);
105 constrained_window_->CloseWebContentsModalDialog(); 105 constrained_window_->CloseWebContentsModalDialog();
106 } 106 }
107 107
108 // static 108 // static
109 ExtensionInstallPrompt::ShowDialogCallback 109 ExtensionInstallPrompt::ShowDialogCallback
110 ExtensionInstallPrompt::GetDefaultShowDialogCallback() { 110 ExtensionInstallPrompt::GetDefaultShowDialogCallback() {
111 return base::Bind(&ShowExtensionInstallDialogImpl); 111 return base::Bind(&ShowExtensionInstallDialogImpl);
112 } 112 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698