| Index: chrome/browser/ui/webui/ntp/app_launcher_handler.cc
|
| diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
|
| index 4521713224cc7852db281c9936f57b05bb21cac7..630bb748a8205e3874823aeaaf271c6a45c69d39 100644
|
| --- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
|
| +++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
|
| @@ -8,7 +8,6 @@
|
|
|
| #include <vector>
|
|
|
| -#include "apps/metrics_names.h"
|
| #include "base/auto_reset.h"
|
| #include "base/bind.h"
|
| #include "base/bind_helpers.h"
|
| @@ -27,7 +26,6 @@
|
| #include "chrome/browser/extensions/launch_util.h"
|
| #include "chrome/browser/favicon/favicon_service_factory.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| -#include "chrome/browser/ui/app_list/app_list_util.h"
|
| #include "chrome/browser/ui/apps/app_info_dialog.h"
|
| #include "chrome/browser/ui/browser_dialogs.h"
|
| #include "chrome/browser/ui/browser_finder.h"
|
| @@ -91,12 +89,10 @@ enum {
|
| APPS_PAGE_ID = 2 << kPageIdOffset,
|
| };
|
|
|
| -void RecordAppLauncherPromoHistogram(
|
| - apps::AppLauncherPromoHistogramValues value) {
|
| - DCHECK_LT(value, apps::APP_LAUNCHER_PROMO_MAX);
|
| - UMA_HISTOGRAM_ENUMERATION(
|
| - "Apps.AppLauncherPromo", value, apps::APP_LAUNCHER_PROMO_MAX);
|
| -}
|
| +// This is used to avoid a DCHECK due to an unhandled WebUI callback. The
|
| +// JavaScript used to switch between pages sends "pageSelected" which is used
|
| +// in the context of the NTP for recording metrics we don't need here.
|
| +void NoOpCallback(const base::ListValue* args) {}
|
|
|
| } // namespace
|
|
|
| @@ -109,10 +105,6 @@ AppLauncherHandler::AppLauncherHandler(ExtensionService* extension_service)
|
| ignore_changes_(false),
|
| attempted_bookmark_app_install_(false),
|
| has_loaded_apps_(false) {
|
| - if (IsAppLauncherEnabled())
|
| - RecordAppLauncherPromoHistogram(apps::APP_LAUNCHER_PROMO_ALREADY_INSTALLED);
|
| - else if (ShouldShowAppLauncherPromo())
|
| - RecordAppLauncherPromoHistogram(apps::APP_LAUNCHER_PROMO_SHOWN);
|
| }
|
|
|
| AppLauncherHandler::~AppLauncherHandler() {
|
| @@ -231,16 +223,6 @@ void AppLauncherHandler::RegisterMessages() {
|
| registrar_.Add(this, chrome::NOTIFICATION_APP_INSTALLED_TO_NTP,
|
| content::Source<WebContents>(web_ui()->GetWebContents()));
|
|
|
| - // Some tests don't have a local state.
|
| -#if defined(ENABLE_APP_LIST)
|
| - if (g_browser_process->local_state()) {
|
| - local_state_pref_change_registrar_.Init(g_browser_process->local_state());
|
| - local_state_pref_change_registrar_.Add(
|
| - prefs::kShowAppLauncherPromo,
|
| - base::Bind(&AppLauncherHandler::OnLocalStatePreferenceChanged,
|
| - base::Unretained(this)));
|
| - }
|
| -#endif
|
| web_ui()->RegisterMessageCallback("getApps",
|
| base::Bind(&AppLauncherHandler::HandleGetApps,
|
| base::Unretained(this)));
|
| @@ -271,15 +253,7 @@ void AppLauncherHandler::RegisterMessages() {
|
| web_ui()->RegisterMessageCallback("generateAppForLink",
|
| base::Bind(&AppLauncherHandler::HandleGenerateAppForLink,
|
| base::Unretained(this)));
|
| - web_ui()->RegisterMessageCallback("stopShowingAppLauncherPromo",
|
| - base::Bind(&AppLauncherHandler::HandleStopShowingAppLauncherPromo,
|
| - base::Unretained(this)));
|
| - web_ui()->RegisterMessageCallback("onLearnMore",
|
| - base::Bind(&AppLauncherHandler::HandleOnLearnMore,
|
| - base::Unretained(this)));
|
| - web_ui()->RegisterMessageCallback("pageSelected",
|
| - base::Bind(&AppLauncherHandler::HandlePageSelected,
|
| - base::Unretained(this)));
|
| + web_ui()->RegisterMessageCallback("pageSelected", base::Bind(&NoOpCallback));
|
| }
|
|
|
| void AppLauncherHandler::Observe(int type,
|
| @@ -734,19 +708,6 @@ void AppLauncherHandler::HandleGenerateAppForLink(const base::ListValue* args) {
|
| &cancelable_task_tracker_);
|
| }
|
|
|
| -void AppLauncherHandler::HandleStopShowingAppLauncherPromo(
|
| - const base::ListValue* args) {
|
| -#if defined(ENABLE_APP_LIST)
|
| - g_browser_process->local_state()->SetBoolean(
|
| - prefs::kShowAppLauncherPromo, false);
|
| - RecordAppLauncherPromoHistogram(apps::APP_LAUNCHER_PROMO_DISMISSED);
|
| -#endif
|
| -}
|
| -
|
| -void AppLauncherHandler::HandleOnLearnMore(const base::ListValue* args) {
|
| - RecordAppLauncherPromoHistogram(apps::APP_LAUNCHER_PROMO_LEARN_MORE);
|
| -}
|
| -
|
| void AppLauncherHandler::HandlePageSelected(const base::ListValue* args) {
|
| double index_double;
|
| CHECK(args->GetDouble(0, &index_double));
|
| @@ -794,15 +755,6 @@ void AppLauncherHandler::OnExtensionPreferenceChanged() {
|
| web_ui()->CallJavascriptFunction("ntp.appsPrefChangeCallback", dictionary);
|
| }
|
|
|
| -void AppLauncherHandler::OnLocalStatePreferenceChanged() {
|
| -#if defined(ENABLE_APP_LIST)
|
| - web_ui()->CallJavascriptFunction(
|
| - "ntp.appLauncherPromoPrefChangeCallback",
|
| - base::FundamentalValue(g_browser_process->local_state()->GetBoolean(
|
| - prefs::kShowAppLauncherPromo)));
|
| -#endif
|
| -}
|
| -
|
| void AppLauncherHandler::CleanupAfterUninstall() {
|
| extension_id_prompting_.clear();
|
| }
|
|
|