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

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

Issue 65043015: [mac] Implement a windowed extension install/permissions prompt. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 7 years 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 | Annotate | Revision Log
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
11 #include "chrome/browser/ui/browser_finder.h" 11 #include "chrome/browser/ui/browser_finder.h"
12 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sh eet.h" 12 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sh eet.h"
13 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_w indow.h" 13 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_w indow.h"
14 #import "chrome/browser/ui/cocoa/extensions/extension_install_view_controller.h" 14 #import "chrome/browser/ui/cocoa/extensions/extension_install_view_controller.h"
15 #import "chrome/browser/ui/cocoa/extensions/windowed_install_dialog_controller.h "
15 #include "chrome/browser/ui/tabs/tab_strip_model.h" 16 #include "chrome/browser/ui/tabs/tab_strip_model.h"
16 #include "content/public/browser/web_contents.h" 17 #include "content/public/browser/web_contents.h"
17 18
18 namespace { 19 namespace {
19 20
20 void ShowExtensionInstallDialogImpl( 21 void ShowExtensionInstallDialogImpl(
21 const ExtensionInstallPrompt::ShowParams& show_params, 22 const ExtensionInstallPrompt::ShowParams& show_params,
22 ExtensionInstallPrompt::Delegate* delegate, 23 ExtensionInstallPrompt::Delegate* delegate,
23 const ExtensionInstallPrompt::Prompt& prompt) { 24 const ExtensionInstallPrompt::Prompt& prompt) {
25 // These objects will delete themselves when the dialog closes.
24 if (!show_params.parent_web_contents) { 26 if (!show_params.parent_web_contents) {
25 // TODO(sail): Add support for showing the dialog without a parent window. 27 new WindowedInstallDialogController(show_params, delegate, prompt);
26 NOTIMPLEMENTED();
27 return; 28 return;
28 } 29 }
29 30
30 // This object will delete itself when the dialog closes.
31 new ExtensionInstallDialogController(show_params, delegate, prompt); 31 new ExtensionInstallDialogController(show_params, delegate, prompt);
32 } 32 }
33 33
34 } // namespace 34 } // namespace
35 35
36 ExtensionInstallDialogController::ExtensionInstallDialogController( 36 ExtensionInstallDialogController::ExtensionInstallDialogController(
37 const ExtensionInstallPrompt::ShowParams& show_params, 37 const ExtensionInstallPrompt::ShowParams& show_params,
38 ExtensionInstallPrompt::Delegate* delegate, 38 ExtensionInstallPrompt::Delegate* delegate,
39 const ExtensionInstallPrompt::Prompt& prompt) : delegate_(delegate) { 39 const ExtensionInstallPrompt::Prompt& prompt) : delegate_(delegate) {
40 view_controller_.reset([[ExtensionInstallViewController alloc] 40 view_controller_.reset([[ExtensionInstallViewController alloc]
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 if (delegate_) 72 if (delegate_)
73 delegate_->InstallUIAbort(false); 73 delegate_->InstallUIAbort(false);
74 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); 74 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
75 } 75 }
76 76
77 // static 77 // static
78 ExtensionInstallPrompt::ShowDialogCallback 78 ExtensionInstallPrompt::ShowDialogCallback
79 ExtensionInstallPrompt::GetDefaultShowDialogCallback() { 79 ExtensionInstallPrompt::GetDefaultShowDialogCallback() {
80 return base::Bind(&ShowExtensionInstallDialogImpl); 80 return base::Bind(&ShowExtensionInstallDialogImpl);
81 } 81 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698