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

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

Issue 1787553003: mac: Remove uses of a CoreGraphics private API that causes WindowServer crashes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add semicolons. Created 4 years, 9 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
« no previous file with comments | « chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sheet.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // The extension install dialog can cause window server crashes when using the
64 // complex animations provided by private APIs, so use simple animations. See
65 // https://crbug.com/548824.
66 [sheet setUseSimpleAnimations:YES];
63 constrained_window_ = CreateAndShowWebModalDialogMac( 67 constrained_window_ = CreateAndShowWebModalDialogMac(
64 this, show_params->GetParentWebContents(), sheet); 68 this, show_params->GetParentWebContents(), sheet);
65 69
66 std::string event_name = ExperienceSamplingEvent::kExtensionInstallDialog; 70 std::string event_name = ExperienceSamplingEvent::kExtensionInstallDialog;
67 event_name.append( 71 event_name.append(
68 ExtensionInstallPrompt::PromptTypeToString(promptType)); 72 ExtensionInstallPrompt::PromptTypeToString(promptType));
69 sampling_event_ = ExperienceSamplingEvent::Create(event_name); 73 sampling_event_ = ExperienceSamplingEvent::Create(event_name);
70 } 74 }
71 75
72 ExtensionInstallDialogController::~ExtensionInstallDialogController() { 76 ExtensionInstallDialogController::~ExtensionInstallDialogController() {
(...skipping 30 matching lines...) Expand all
103 sampling_event_->CreateUserDecisionEvent(decision_event); 107 sampling_event_->CreateUserDecisionEvent(decision_event);
104 base::ResetAndReturn(&done_callback_).Run(result); 108 base::ResetAndReturn(&done_callback_).Run(result);
105 constrained_window_->CloseWebContentsModalDialog(); 109 constrained_window_->CloseWebContentsModalDialog();
106 } 110 }
107 111
108 // static 112 // static
109 ExtensionInstallPrompt::ShowDialogCallback 113 ExtensionInstallPrompt::ShowDialogCallback
110 ExtensionInstallPrompt::GetDefaultShowDialogCallback() { 114 ExtensionInstallPrompt::GetDefaultShowDialogCallback() {
111 return base::Bind(&ShowExtensionInstallDialogImpl); 115 return base::Bind(&ShowExtensionInstallDialogImpl);
112 } 116 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sheet.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698