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

Unified Diff: chrome/browser/ui/webui/ntp/app_launcher_handler.cc

Issue 8662051: retry r112077 - recently closed menu: respect middle click (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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
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 71d2ca82a3aa4568027c3f88a285b9370c94c056..7294940bf1356cdd8d033a17a385c41ad647e6ea 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -30,6 +30,7 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/webui/extension_icon_source.h"
#include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
+#include "chrome/browser/ui/webui/web_ui_util.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
@@ -39,7 +40,6 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "chrome/common/web_apps.h"
-#include "content/browser/disposition_utils.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/public/browser/notification_service.h"
#include "googleurl/src/gurl.h"
@@ -49,7 +49,6 @@
#include "ui/base/animation/animation.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/codec/png_codec.h"
-#include "webkit/glue/window_open_disposition.h"
namespace {
@@ -509,25 +508,12 @@ void AppLauncherHandler::HandleGetApps(const ListValue* args) {
void AppLauncherHandler::HandleLaunchApp(const ListValue* args) {
std::string extension_id;
- double source = -1.0;
- std::string url;
- bool alt_key = false;
- bool ctrl_key = false;
- bool meta_key = false;
- bool shift_key = false;
- double button = 0.0;
-
CHECK(args->GetString(0, &extension_id));
+ double source = -1.0;
CHECK(args->GetDouble(1, &source));
+ std::string url;
if (args->GetSize() > 2)
CHECK(args->GetString(2, &url));
- if (args->GetSize() > 3) {
- CHECK(args->GetBoolean(3, &alt_key));
- CHECK(args->GetBoolean(4, &ctrl_key));
- CHECK(args->GetBoolean(5, &meta_key));
- CHECK(args->GetBoolean(6, &shift_key));
- CHECK(args->GetDouble(7, &button));
- }
extension_misc::AppLaunchBucket launch_bucket =
static_cast<extension_misc::AppLaunchBucket>(
@@ -546,13 +532,8 @@ void AppLauncherHandler::HandleLaunchApp(const ListValue* args) {
Profile* profile = extension_service_->profile();
- // If the user pressed special keys when clicking, override the saved
- // preference for launch container.
- bool middle_button = (button == 1.0);
- WindowOpenDisposition disposition =
- disposition_utils::DispositionFromClick(middle_button, alt_key,
- ctrl_key, meta_key, shift_key);
-
+ WindowOpenDisposition disposition = args->GetSize() > 3 ?
+ web_ui_util::GetDispositionFromClick(args, 3) : CURRENT_TAB;
if (extension_id != extension_misc::kWebStoreAppId) {
RecordAppLaunchByID(launch_bucket);
extension_service_->apps_promo()->ExpireDefaultApps();
« no previous file with comments | « chrome/browser/ui/gtk/global_history_menu.cc ('k') | chrome/browser/ui/webui/ntp/recently_closed_tabs_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698