#include "extensions/browser/extension_system.h"
#include "extensions/browser/management_policy.h"
#include "extensions/browser/pref_names.h"
+#include "extensions/browser/uninstall_reason.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_icon_set.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/webui/web_ui_util.h"
-#include "ui/gfx/favicon_size.h"
#include "url/gurl.h"
using content::WebContents;
return;
switch (type) {
- case chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED: {
+ case extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED: {
const Extension* extension =
content::Details<const Extension>(details).ptr();
if (!extension->is_app())
ExtensionPrefs* prefs =
ExtensionPrefs::Get(extension_service_->profile());
- scoped_ptr<base::FundamentalValue> highlight(
- base::Value::CreateBooleanValue(
- prefs->IsFromBookmark(extension->id()) &&
- attempted_bookmark_app_install_));
+ base::FundamentalValue highlight(
+ prefs->IsFromBookmark(extension->id()) &&
+ attempted_bookmark_app_install_);
attempted_bookmark_app_install_ = false;
- web_ui()->CallJavascriptFunction(
- "ntp.appAdded", *app_info, *highlight);
+ web_ui()->CallJavascriptFunction("ntp.appAdded", *app_info, highlight);
}
break;
}
- case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED:
- case chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED: {
+ case extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED:
+ case extensions::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED: {
const Extension* extension = NULL;
bool uninstalled = false;
- if (type == chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED) {
+ if (type == extensions::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED) {
extension = content::Details<const Extension>(details).ptr();
uninstalled = true;
} else { // NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED
if (uninstalled)
visible_apps_.erase(extension->id());
- scoped_ptr<base::FundamentalValue> uninstall_value(
- base::Value::CreateBooleanValue(uninstalled));
- scoped_ptr<base::FundamentalValue> from_page(
- base::Value::CreateBooleanValue(!extension_id_prompting_.empty()));
web_ui()->CallJavascriptFunction(
- "ntp.appRemoved", *app_info, *uninstall_value, *from_page);
+ "ntp.appRemoved",
+ *app_info,
+ base::FundamentalValue(uninstalled),
+ base::FundamentalValue(!extension_id_prompting_.empty()));
}
break;
}
- case chrome::NOTIFICATION_EXTENSION_LAUNCHER_REORDERED: {
+ case chrome::NOTIFICATION_APP_LAUNCHER_REORDERED: {
const std::string* id =
content::Details<const std::string>(details).ptr();
if (id) {
}
break;
}
- case chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR: {
+ case extensions::NOTIFICATION_EXTENSION_INSTALL_ERROR: {
CrxInstaller* crx_installer = content::Source<CrxInstaller>(source).ptr();
if (!Profile::FromWebUI(web_ui())->IsSameProfile(
crx_installer->profile())) {
}
// Fall through.
}
- case chrome::NOTIFICATION_EXTENSION_LOAD_ERROR: {
+ case extensions::NOTIFICATION_EXTENSION_LOAD_ERROR: {
attempted_bookmark_app_install_ = false;
break;
}
extension_pref_change_registrar_.Add(prefs::kNtpAppPageNames, callback);
registrar_.Add(this,
- chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
+ extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
+ content::Source<Profile>(profile));
+ registrar_.Add(this,
+ extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
content::Source<Profile>(profile));
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
- content::Source<Profile>(profile));
registrar_.Add(this,
- chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
+ extensions::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
content::Source<Profile>(profile));
registrar_.Add(this,
- chrome::NOTIFICATION_EXTENSION_LAUNCHER_REORDERED,
+ chrome::NOTIFICATION_APP_LAUNCHER_REORDERED,
content::Source<AppSorting>(
ExtensionPrefs::Get(profile)->app_sorting()));
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR,
- content::Source<CrxInstaller>(NULL));
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOAD_ERROR,
- content::Source<Profile>(profile));
+ registrar_.Add(this,
+ extensions::NOTIFICATION_EXTENSION_INSTALL_ERROR,
+ content::Source<CrxInstaller>(NULL));
+ registrar_.Add(this,
+ extensions::NOTIFICATION_EXTENSION_LOAD_ERROR,
+ content::Source<Profile>(profile));
}
has_loaded_apps_ = true;
install_info->page_ordinal = page_ordinal;
favicon_service->GetFaviconImageForPageURL(
- FaviconService::FaviconForPageURLParams(
- launch_url, favicon_base::FAVICON, gfx::kFaviconSize),
+ launch_url,
base::Bind(&AppLauncherHandler::OnFaviconForApp,
base::Unretained(this),
base::Passed(&install_info)),
if (!extension)
return;
- extension_service_->UninstallExtension(extension_id_prompting_,
- false /* external_uninstall */, NULL);
+ extension_service_->UninstallExtension(
+ extension_id_prompting_,
+ extensions::UNINSTALL_REASON_USER_INITIATED,
+ base::Bind(&base::DoNothing),
+ NULL);
CleanupAfterUninstall();
}
web_ui()->GetWebContents());
extension_uninstall_dialog_.reset(
extensions::ExtensionUninstallDialog::Create(
- extension_service_->profile(), browser, this));
+ extension_service_->profile(),
+ browser->window()->GetNativeWindow(),
+ this));
}
return extension_uninstall_dialog_.get();
}