summaryrefslogtreecommitdiffstats
path: root/webkit/glue/web_intent_service_data.cc
diff options
context:
space:
mode:
authorsmckay@chromium.org <smckay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-28 21:24:43 +0000
committersmckay@chromium.org <smckay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-28 21:24:43 +0000
commitf928b89b660fe3ec965a19d784e80285c2957477 (patch)
tree28e86e8bec9a07e89db7121c70052d0873e13c51 /webkit/glue/web_intent_service_data.cc
parent67037167af9c70a339e8d78ba2ee3287646bf6c0 (diff)
downloadchromium_src-f928b89b660fe3ec965a19d784e80285c2957477.zip
chromium_src-f928b89b660fe3ec965a19d784e80285c2957477.tar.gz
chromium_src-f928b89b660fe3ec965a19d784e80285c2957477.tar.bz2
Add "scheme" field to WebIntentServiceData object.
Add unittest for web_intent_service_data. Reorder constructor args to group service url with title. BUG=129199 TEST=./out/Debug/unit_tests --gtest_filter=WebIntentServiceDataTest.* +jamesr AND brettw for webkit_glue changes. Review URL: https://chromiumcodereview.appspot.com/10541125 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144800 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/web_intent_service_data.cc')
-rw-r--r--webkit/glue/web_intent_service_data.cc31
1 files changed, 18 insertions, 13 deletions
diff --git a/webkit/glue/web_intent_service_data.cc b/webkit/glue/web_intent_service_data.cc
index 4367b60..a9d1a0a 100644
--- a/webkit/glue/web_intent_service_data.cc
+++ b/webkit/glue/web_intent_service_data.cc
@@ -16,22 +16,25 @@ WebIntentServiceData::WebIntentServiceData()
: disposition(WebIntentServiceData::DISPOSITION_WINDOW) {
}
-WebIntentServiceData::WebIntentServiceData(const GURL& svc_url,
- const string16& svc_action,
+WebIntentServiceData::WebIntentServiceData(const string16& svc_action,
const string16& svc_type,
+ const string16& svc_scheme,
+ const GURL& svc_service_url,
const string16& svc_title)
- : service_url(svc_url),
- action(svc_action),
+ : action(svc_action),
type(svc_type),
+ scheme(svc_scheme),
+ service_url(svc_service_url),
title(svc_title),
disposition(WebIntentServiceData::DISPOSITION_WINDOW) {
}
WebIntentServiceData::WebIntentServiceData(
const WebKit::WebIntentServiceInfo& info)
- : service_url(info.url()),
- action(info.action()),
+ : action(info.action()),
type(info.type()),
+ scheme(string16()),
+ service_url(info.url()),
title(info.title()),
disposition(WebIntentServiceData::DISPOSITION_WINDOW) {
setDisposition(info.disposition());
@@ -40,9 +43,10 @@ WebIntentServiceData::WebIntentServiceData(
WebIntentServiceData::~WebIntentServiceData() {}
bool WebIntentServiceData::operator==(const WebIntentServiceData& other) const {
- return service_url == other.service_url &&
- action == other.action &&
+ return action == other.action &&
type == other.type &&
+ scheme == other.scheme &&
+ service_url == other.service_url &&
title == other.title &&
disposition == other.disposition;
}
@@ -57,11 +61,12 @@ void WebIntentServiceData::setDisposition(const string16& disp) {
std::ostream& operator<<(::std::ostream& os,
const WebIntentServiceData& intent) {
return os <<
- "{" << intent.service_url <<
- ", " << UTF16ToUTF8(intent.action) <<
- ", " << UTF16ToUTF8(intent.type) <<
- ", " << UTF16ToUTF8(intent.title) <<
- ", " << intent.disposition <<
+ "{action=" << UTF16ToUTF8(intent.action) <<
+ "type=, " << UTF16ToUTF8(intent.type) <<
+ "scheme=, " << UTF16ToUTF8(intent.scheme) <<
+ "service_url=, " << intent.service_url <<
+ "title=, " << UTF16ToUTF8(intent.title) <<
+ "disposition=, " << intent.disposition <<
"}";
}