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

Unified Diff: chrome/browser/ui/webui/web_ui_util.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
« no previous file with comments | « chrome/browser/ui/webui/web_ui_util.h ('k') | content/browser/disposition_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/web_ui_util.cc
diff --git a/chrome/browser/ui/webui/web_ui_util.cc b/chrome/browser/ui/webui/web_ui_util.cc
index ee854acfe214e0254f40afbf3765e3f5d3bce7da..4914de63d57cd32a03dab06beaf6bccc1a801fed 100644
--- a/chrome/browser/ui/webui/web_ui_util.cc
+++ b/chrome/browser/ui/webui/web_ui_util.cc
@@ -7,6 +7,8 @@
#include <vector>
#include "base/base64.h"
+#include "base/values.h"
+#include "content/browser/disposition_utils.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/codec/png_codec.h"
@@ -39,4 +41,22 @@ std::string GetImageDataUrlFromResource(int res) {
return str_url;
}
+WindowOpenDisposition GetDispositionFromClick(const ListValue* args,
+ int start_index) {
+ double button = 0.0;
+ bool alt_key = false;
+ bool ctrl_key = false;
+ bool meta_key = false;
+ bool shift_key = false;
+
+ CHECK(args->GetDouble(start_index++, &button));
+ CHECK(args->GetBoolean(start_index++, &alt_key));
+ CHECK(args->GetBoolean(start_index++, &ctrl_key));
+ CHECK(args->GetBoolean(start_index++, &meta_key));
+ CHECK(args->GetBoolean(start_index++, &shift_key));
+ return disposition_utils::DispositionFromClick(button == 1.0, alt_key,
+ ctrl_key, meta_key, shift_key);
+
+}
+
} // namespace web_ui_util
« no previous file with comments | « chrome/browser/ui/webui/web_ui_util.h ('k') | content/browser/disposition_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698