summaryrefslogtreecommitdiffstats
path: root/chrome/browser/intents
diff options
context:
space:
mode:
authorgbillock@chromium.org <gbillock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-09 23:19:45 +0000
committergbillock@chromium.org <gbillock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-09 23:19:45 +0000
commit778cf547150c7ae1b7bc238d97844285e65111ef (patch)
tree96cc015c811a43c568321d2ce00a6374902a40c1 /chrome/browser/intents
parentd87b638ae73de94c2bbd59468e0409c91abbe582 (diff)
downloadchromium_src-778cf547150c7ae1b7bc238d97844285e65111ef.zip
chromium_src-778cf547150c7ae1b7bc238d97844285e65111ef.tar.gz
chromium_src-778cf547150c7ae1b7bc238d97844285e65111ef.tar.bz2
Modify schema to include defaulting information.
R=jhawkins@chromium.org,binji@chromium.org,groby@chromium.org BUG=110636 TEST=None yet Review URL: http://codereview.chromium.org/9104018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121330 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/intents')
-rw-r--r--chrome/browser/intents/default_web_intent_service.cc10
-rw-r--r--chrome/browser/intents/default_web_intent_service.h41
2 files changed, 51 insertions, 0 deletions
diff --git a/chrome/browser/intents/default_web_intent_service.cc b/chrome/browser/intents/default_web_intent_service.cc
new file mode 100644
index 0000000..c34c974
--- /dev/null
+++ b/chrome/browser/intents/default_web_intent_service.cc
@@ -0,0 +1,10 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/intents/default_web_intent_service.h"
+
+DefaultWebIntentService::DefaultWebIntentService()
+ : url_pattern(URLPattern::SCHEME_ALL), user_date(-1), suppression(0) {}
+
+DefaultWebIntentService::~DefaultWebIntentService() {}
diff --git a/chrome/browser/intents/default_web_intent_service.h b/chrome/browser/intents/default_web_intent_service.h
new file mode 100644
index 0000000..c1962ac
--- /dev/null
+++ b/chrome/browser/intents/default_web_intent_service.h
@@ -0,0 +1,41 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_INTENTS_DEFAULT_WEB_INTENT_SERVICE_H_
+#define CHROME_BROWSER_INTENTS_DEFAULT_WEB_INTENT_SERVICE_H_
+
+#include <string>
+
+#include "base/string16.h"
+#include "chrome/common/extensions/url_pattern.h"
+
+// Holds data related to a default settings for web intents service
+// selection. Holds data in a row in the web_intents_defaults table.
+// The key for the table is the |action|, |type|, and |url_pattern|.
+// These describe the action and type of the web intent for which the
+// default is set, and the url prefix (if any) of source pages for
+// which the default applies. The main actionable value is the URL
+// of the service or extension page handling the intent. The |user_date|
+// and |suppression| fields are provided for more intricate post-fetch
+// decisions about whether to use a particular default service.
+struct DefaultWebIntentService {
+ string16 action;
+ string16 type;
+ URLPattern url_pattern;
+
+ // |user_date| holds the offset time when a user set the default.
+ // If the user did not set the default explicitly, is <= 0.
+ int user_date;
+
+ // |suppression| holds a value modeling whether a default is suppressed.
+ // If it has value == 0, the default is active.
+ int suppression;
+
+ std::string service_url;
+
+ DefaultWebIntentService();
+ ~DefaultWebIntentService();
+};
+
+#endif // CHROME_BROWSER_INTENTS_DEFAULT_WEB_INTENT_SERVICE_H_