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 9f336ec5ec1cf73a1b681a0f140cfd374903908d..f214a96b361c87bb62f42816f06d0ef28a58dbf5 100644 |
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc |
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc |
@@ -26,6 +26,7 @@ |
#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" |
#include "chrome/browser/ui/browser_tabstrip.h" |
@@ -222,6 +223,9 @@ void AppLauncherHandler::RegisterMessages() { |
web_ui()->RegisterMessageCallback("createAppShortcut", |
base::Bind(&AppLauncherHandler::HandleCreateAppShortcut, |
base::Unretained(this))); |
+ web_ui()->RegisterMessageCallback("showAppInfo", |
+ base::Bind(&AppLauncherHandler::HandleShowAppInfo, |
+ base::Unretained(this))); |
web_ui()->RegisterMessageCallback("reorderApps", |
base::Bind(&AppLauncherHandler::HandleReorderApps, |
base::Unretained(this))); |
@@ -614,6 +618,24 @@ void AppLauncherHandler::HandleCreateAppShortcut(const base::ListValue* args) { |
base::Callback<void(bool)>()); |
} |
+void AppLauncherHandler::HandleShowAppInfo(const base::ListValue* args) { |
+ std::string extension_id; |
+ CHECK(args->GetString(0, &extension_id)); |
+ |
+ const Extension* extension = |
+ extension_service_->GetExtensionById(extension_id, true); |
+ DCHECK(extension); |
tapted
2015/02/12 22:45:39
If this is an asynchronous call (it probably is),
|
+ |
+ UMA_HISTOGRAM_ENUMERATION("Apps.AppInfoDialog.Launches", |
+ AppInfoLaunchSource::FROM_APPS_PAGE, |
+ AppInfoLaunchSource::NUM_LAUNCH_SOURCES); |
+ |
+ ShowAppInfoInNativeDialog( |
+ web_ui()->GetWebContents()->GetTopLevelNativeWindow(), |
+ GetAppInfoNativeDialogSize(), Profile::FromWebUI(web_ui()), extension, |
+ base::Bind(&base::DoNothing)); |
tapted
2015/02/12 22:45:39
Unless there's a reason for (I don't think there i
tsergeant
2015/02/12 23:56:27
Ah, cool. This way of doing callbacks is new to me
|
+} |
+ |
void AppLauncherHandler::HandleReorderApps(const base::ListValue* args) { |
CHECK(args->GetSize() == 2); |