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

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

Issue 8198003: Convert app_launch_index and page_index from int to StringOrdinal. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Changing ..MinAndMax.. to ..MinOrMax.. Created 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/crx_installer.h" 5 #include "chrome/browser/extensions/crx_installer.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 return false; 125 return false;
126 } 126 }
127 127
128 CrxInstaller::CrxInstaller(base::WeakPtr<ExtensionService> frontend_weak, 128 CrxInstaller::CrxInstaller(base::WeakPtr<ExtensionService> frontend_weak,
129 ExtensionInstallUI* client) 129 ExtensionInstallUI* client)
130 : install_directory_(frontend_weak->install_directory()), 130 : install_directory_(frontend_weak->install_directory()),
131 install_source_(Extension::INTERNAL), 131 install_source_(Extension::INTERNAL),
132 extensions_enabled_(frontend_weak->extensions_enabled()), 132 extensions_enabled_(frontend_weak->extensions_enabled()),
133 delete_source_(false), 133 delete_source_(false),
134 create_app_shortcut_(false), 134 create_app_shortcut_(false),
135 page_index_(-1),
136 frontend_weak_(frontend_weak), 135 frontend_weak_(frontend_weak),
137 profile_(frontend_weak->profile()), 136 profile_(frontend_weak->profile()),
138 client_(client), 137 client_(client),
139 apps_require_extension_mime_type_(false), 138 apps_require_extension_mime_type_(false),
140 allow_silent_install_(false), 139 allow_silent_install_(false),
141 install_cause_(extension_misc::INSTALL_CAUSE_UNSET), 140 install_cause_(extension_misc::INSTALL_CAUSE_UNSET),
142 creation_flags_(Extension::NO_FLAGS) { 141 creation_flags_(Extension::NO_FLAGS) {
143 } 142 }
144 143
145 CrxInstaller::~CrxInstaller() { 144 CrxInstaller::~CrxInstaller() {
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 // We update the extension's granted permissions if the user already approved 578 // We update the extension's granted permissions if the user already approved
580 // the install (client_ is non NULL), or we are allowed to install this 579 // the install (client_ is non NULL), or we are allowed to install this
581 // silently. We only track granted permissions for INTERNAL extensions. 580 // silently. We only track granted permissions for INTERNAL extensions.
582 if ((client_ || allow_silent_install_) && 581 if ((client_ || allow_silent_install_) &&
583 extension_->location() == Extension::INTERNAL) 582 extension_->location() == Extension::INTERNAL)
584 frontend_weak_->GrantPermissions(extension_); 583 frontend_weak_->GrantPermissions(extension_);
585 584
586 // Tell the frontend about the installation and hand off ownership of 585 // Tell the frontend about the installation and hand off ownership of
587 // extension_ to it. 586 // extension_ to it.
588 frontend_weak_->OnExtensionInstalled(extension_, is_gallery_install(), 587 frontend_weak_->OnExtensionInstalled(extension_, is_gallery_install(),
589 page_index_); 588 page_ordinal_);
590 589
591 NotifyCrxInstallComplete(extension_.get()); 590 NotifyCrxInstallComplete(extension_.get());
592 591
593 extension_ = NULL; 592 extension_ = NULL;
594 593
595 // We're done. We don't post any more tasks to ourselves so we are deleted 594 // We're done. We don't post any more tasks to ourselves so we are deleted
596 // soon. 595 // soon.
597 } 596 }
598 597
599 void CrxInstaller::NotifyCrxInstallComplete(const Extension* extension) { 598 void CrxInstaller::NotifyCrxInstallComplete(const Extension* extension) {
600 // Some users (such as the download shelf) need to know when a 599 // Some users (such as the download shelf) need to know when a
601 // CRXInstaller is done. Listening for the EXTENSION_* events 600 // CRXInstaller is done. Listening for the EXTENSION_* events
602 // is problematic because they don't know anything about the 601 // is problematic because they don't know anything about the
603 // extension before it is unpacked, so they cannot filter based 602 // extension before it is unpacked, so they cannot filter based
604 // on the extension. 603 // on the extension.
605 content::NotificationService::current()->Notify( 604 content::NotificationService::current()->Notify(
606 chrome::NOTIFICATION_CRX_INSTALLER_DONE, 605 chrome::NOTIFICATION_CRX_INSTALLER_DONE,
607 content::Source<CrxInstaller>(this), 606 content::Source<CrxInstaller>(this),
608 content::Details<const Extension>(extension)); 607 content::Details<const Extension>(extension));
609 } 608 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698