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

Side by Side Diff: chrome/browser/extensions/unpacked_installer.cc

Issue 11035017: Mac Web Intents Part 15: Inline extension install prompt (model) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments Created 8 years, 2 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 | 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 #include "chrome/browser/extensions/unpacked_installer.h" 5 #include "chrome/browser/extensions/unpacked_installer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
11 #include "base/threading/thread_restrictions.h" 11 #include "base/threading/thread_restrictions.h"
12 #include "chrome/browser/extensions/extension_install_dialog.h"
12 #include "chrome/browser/extensions/extension_install_prompt.h" 13 #include "chrome/browser/extensions/extension_install_prompt.h"
13 #include "chrome/browser/extensions/extension_install_ui.h" 14 #include "chrome/browser/extensions/extension_install_ui.h"
14 #include "chrome/browser/extensions/extension_prefs.h" 15 #include "chrome/browser/extensions/extension_prefs.h"
15 #include "chrome/browser/extensions/extension_service.h" 16 #include "chrome/browser/extensions/extension_service.h"
16 #include "chrome/browser/extensions/permissions_updater.h" 17 #include "chrome/browser/extensions/permissions_updater.h"
17 #include "chrome/browser/extensions/requirements_checker.h" 18 #include "chrome/browser/extensions/requirements_checker.h"
18 #include "chrome/common/extensions/extension.h" 19 #include "chrome/common/extensions/extension.h"
19 #include "chrome/common/extensions/extension_file_util.h" 20 #include "chrome/common/extensions/extension_file_util.h"
20 #include "sync/api/string_ordinal.h" 21 #include "sync/api/string_ordinal.h"
21 22
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 : service_weak_(extension_service), 55 : service_weak_(extension_service),
55 extension_(extension) { 56 extension_(extension) {
56 install_ui_.reset( 57 install_ui_.reset(
57 ExtensionInstallUI::CreateInstallPromptWithProfile(profile)); 58 ExtensionInstallUI::CreateInstallPromptWithProfile(profile));
58 } 59 }
59 60
60 SimpleExtensionLoadPrompt::~SimpleExtensionLoadPrompt() { 61 SimpleExtensionLoadPrompt::~SimpleExtensionLoadPrompt() {
61 } 62 }
62 63
63 void SimpleExtensionLoadPrompt::ShowPrompt() { 64 void SimpleExtensionLoadPrompt::ShowPrompt() {
64 install_ui_->ConfirmInstall(this, extension_); 65 install_ui_->ConfirmInstall(
66 this, extension_, base::Bind(ShowExtensionInstallDialogImpl));
Greg Billock 2012/10/03 21:15:39 I think needs & here and the other place, right?
65 } 67 }
66 68
67 void SimpleExtensionLoadPrompt::InstallUIProceed() { 69 void SimpleExtensionLoadPrompt::InstallUIProceed() {
68 if (service_weak_.get()) { 70 if (service_weak_.get()) {
69 extensions::PermissionsUpdater perms_updater(service_weak_->profile()); 71 extensions::PermissionsUpdater perms_updater(service_weak_->profile());
70 perms_updater.GrantActivePermissions(extension_, false); 72 perms_updater.GrantActivePermissions(extension_, false);
71 service_weak_->OnExtensionInstalled( 73 service_weak_->OnExtensionInstalled(
72 extension_, 74 extension_,
73 false, // Not from web store. 75 false, // Not from web store.
74 syncer::StringOrdinal(), 76 syncer::StringOrdinal(),
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 263
262 PermissionsUpdater perms_updater(service_weak_->profile()); 264 PermissionsUpdater perms_updater(service_weak_->profile());
263 perms_updater.GrantActivePermissions(extension_, false); 265 perms_updater.GrantActivePermissions(extension_, false);
264 service_weak_->OnExtensionInstalled(extension_, 266 service_weak_->OnExtensionInstalled(extension_,
265 false, // Not from web store. 267 false, // Not from web store.
266 syncer::StringOrdinal(), 268 syncer::StringOrdinal(),
267 false /* no requirement errors */); 269 false /* no requirement errors */);
268 } 270 }
269 271
270 } // namespace extensions 272 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698