diff options
author | kmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-03 21:05:01 +0000 |
---|---|---|
committer | kmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-03 21:05:01 +0000 |
commit | 036056a357cf18b30070a1900164d1bf3967c39e (patch) | |
tree | db6b3db45195d2c7660642d159a08db11ed1e17a /content/browser | |
parent | c41486d8085c6b748a26734701f0a02bafd18716 (diff) | |
download | chromium_src-036056a357cf18b30070a1900164d1bf3967c39e.zip chromium_src-036056a357cf18b30070a1900164d1bf3967c39e.tar.gz chromium_src-036056a357cf18b30070a1900164d1bf3967c39e.tar.bz2 |
Remove web_ui_util helper functions.
Remove web_ui_util::GetJsonResponseFromFirstArgumentInList() &
web_ui_util::GetJsonResponseFromArgumentList().
Associated review at: http://codereview.chromium.org/6574007/
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6581041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76806 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser')
-rw-r--r-- | content/browser/webui/web_ui_util.cc | 23 | ||||
-rw-r--r-- | content/browser/webui/web_ui_util.h | 20 |
2 files changed, 0 insertions, 43 deletions
diff --git a/content/browser/webui/web_ui_util.cc b/content/browser/webui/web_ui_util.cc index e76aaef..eee1eca 100644 --- a/content/browser/webui/web_ui_util.cc +++ b/content/browser/webui/web_ui_util.cc @@ -7,34 +7,11 @@ #include <vector> #include "base/base64.h" -#include "base/logging.h" -#include "base/values.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/codec/png_codec.h" namespace web_ui_util { -std::string GetJsonResponseFromFirstArgumentInList(const ListValue* args) { - return GetJsonResponseFromArgumentList(args, 0); -} - -std::string GetJsonResponseFromArgumentList(const ListValue* args, - size_t list_index) { - std::string result; - if (args->GetSize() <= list_index) { - NOTREACHED(); - return result; - } - - Value* value = NULL; - if (args->Get(list_index, &value)) - value->GetAsString(&result); - else - NOTREACHED(); - - return result; -} - std::string GetImageDataUrl(const SkBitmap& bitmap) { std::vector<unsigned char> output; gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, false, &output); diff --git a/content/browser/webui/web_ui_util.h b/content/browser/webui/web_ui_util.h index d7034dc..368aa5d 100644 --- a/content/browser/webui/web_ui_util.h +++ b/content/browser/webui/web_ui_util.h @@ -8,30 +8,10 @@ #include <string> -class ListValue; class SkBitmap; namespace web_ui_util { -// Convenience routine to get the response string from an argument -// list. Typically used when supporting a WebUI and getting calls -// from the hosted code. Content must be a ListValue with at least -// one entry in it, and that first entry must be a string, which is -// returned. The parameter is a Value for convenience. Returns an -// empty string on error or if the parameter is not a ListValue. -std::string GetJsonResponseFromFirstArgumentInList(const ListValue* args); - -// Convenience routine to get one of the response strings from an -// argument list. content must be a ListValue, with at least -// (list_index+1) entries in it. list_index is the 0-based index of -// the entry to pull from that list, and that entry must be a string, -// which is returned. The parameter is a Value for convenience. -// Returns an empty string on error or if the parameter is not a -// ListValue. -std::string GetJsonResponseFromArgumentList(const ListValue* args, - size_t list_index); - - // Convenience routine to convert SkBitmap object to data url // so that it can be used in WebUI. std::string GetImageDataUrl(const SkBitmap& bitmap); |