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 |