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

Unified Diff: chrome/browser/dom_ui/app_launcher_handler.cc

Issue 3522015: Implement new strategy for default apps (Closed)
Patch Set: all done Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/dom_ui/app_launcher_handler.h ('k') | chrome/browser/dom_ui/new_tab_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/app_launcher_handler.cc
diff --git a/chrome/browser/dom_ui/app_launcher_handler.cc b/chrome/browser/dom_ui/app_launcher_handler.cc
index 9c867d1b214c7d9016f07992c3d73e8dcb16ed46..e83475474796ff2d8331849681c45685c3a219f2 100644
--- a/chrome/browser/dom_ui/app_launcher_handler.cc
+++ b/chrome/browser/dom_ui/app_launcher_handler.cc
@@ -12,9 +12,11 @@
#include "chrome/browser/app_launched_animation.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_list.h"
+#include "chrome/browser/extensions/default_apps.h"
#include "chrome/browser/extensions/extension_prefs.h"
#include "chrome/browser/extensions/extensions_service.h"
#include "chrome/browser/platform_util.h"
+#include "chrome/browser/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension.h"
@@ -73,6 +75,8 @@ void AppLauncherHandler::RegisterMessages() {
NewCallback(this, &AppLauncherHandler::HandleSetLaunchType));
dom_ui_->RegisterMessageCallback("uninstallApp",
NewCallback(this, &AppLauncherHandler::HandleUninstallApp));
+ dom_ui_->RegisterMessageCallback("hideAppsPromo",
+ NewCallback(this, &AppLauncherHandler::HandleHideAppsPromo));
}
void AppLauncherHandler::Observe(NotificationType type,
@@ -133,6 +137,14 @@ void AppLauncherHandler::FillAppDictionary(DictionaryValue* dictionary) {
}
}
dictionary->Set("apps", list);
+
+ DefaultApps* default_apps = extensions_service_->default_apps();
+ if (default_apps->ShouldShowPromo(extensions_service_->GetAppIds())) {
+ dictionary->SetBoolean("showPromo", true);
+ default_apps->DidShowPromo();
+ } else {
+ dictionary->SetBoolean("showPromo", false);
+ }
}
void AppLauncherHandler::HandleGetApps(const ListValue* args) {
@@ -245,6 +257,10 @@ void AppLauncherHandler::HandleUninstallApp(const ListValue* args) {
GetExtensionInstallUI()->ConfirmUninstall(this, extension);
}
+void AppLauncherHandler::HandleHideAppsPromo(const ListValue* args) {
+ extensions_service_->default_apps()->SetPromoHidden();
+}
+
ExtensionInstallUI* AppLauncherHandler::GetExtensionInstallUI() {
if (!install_ui_.get())
install_ui_.reset(new ExtensionInstallUI(dom_ui_->GetProfile()));
« no previous file with comments | « chrome/browser/dom_ui/app_launcher_handler.h ('k') | chrome/browser/dom_ui/new_tab_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698