Chromium Code Reviews| 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..62da46f597b852ddb932e1caf5f779ad51fba151 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,20 @@ 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); |
|
sashab
2015/02/06 16:23:00
DCHECK(extension) here
tsergeant
2015/02/09 03:10:49
Done.
|
| + |
| + // Display the dialog at a size similar to the app list. |
|
sashab
2015/02/06 16:23:00
Don't need this comment - code explains it, and wi
tsergeant
2015/02/09 03:10:49
Done.
|
| + ShowAppInfoInNativeDialog( |
| + web_ui()->GetWebContents()->GetTopLevelNativeWindow(), |
| + GetApproximateAppListSize(), |
| + Profile::FromWebUI(web_ui()), extension, base::Bind(&base::DoNothing)); |
| +} |
| + |
| void AppLauncherHandler::HandleReorderApps(const base::ListValue* args) { |
| CHECK(args->GetSize() == 2); |