OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef WEBKIT_GLUE_WEB_INTENT_SERVICE_DATA_H_ | |
6 #define WEBKIT_GLUE_WEB_INTENT_SERVICE_DATA_H_ | |
7 | |
8 #include <iosfwd> | |
9 | |
10 #include "base/string16.h" | |
11 #include "googleurl/src/gurl.h" | |
12 #include "webkit/glue/webkit_glue_export.h" | |
13 | |
14 namespace WebKit { | |
15 class WebIntentServiceInfo; | |
16 } | |
17 | |
18 namespace webkit_glue { | |
19 | |
20 // Describes the relevant elements of a WebIntent service. | |
21 struct WEBKIT_GLUE_EXPORT WebIntentServiceData { | |
22 // An intents disposition determines which context the service is opened in. | |
23 enum Disposition { | |
24 DISPOSITION_WINDOW, // Service is presented inside a new tab. (Default) | |
25 DISPOSITION_INLINE, // Service is presented inside the picker UI window. | |
26 DISPOSITION_NATIVE, // Service supplies it's own native UI in browser. | |
27 }; | |
28 | |
29 WebIntentServiceData(); | |
30 WebIntentServiceData(const string16& action, | |
31 const string16& type, | |
32 const string16& scheme, | |
33 const GURL& service_url, | |
34 const string16& title); | |
35 explicit WebIntentServiceData(const WebKit::WebIntentServiceInfo& info); | |
36 ~WebIntentServiceData(); | |
37 | |
38 bool operator==(const WebIntentServiceData& other) const; | |
39 | |
40 void setDisposition(const string16& disp); | |
41 | |
42 // |action|+|type| forms one type of unique service key. The other is | |
43 // |scheme|. | |
44 string16 action; // Name of action provided by service. | |
45 string16 type; // MIME type of data accepted by service. | |
46 | |
47 // |scheme| forms one type of unique service key. The other is | |
48 // |action|+|type|. Note that this scheme is for purposes | |
49 // of matching intent services, not the scheme associated | |
50 // with the service_url. | |
51 string16 scheme; // Protocol scheme for intent service matching. | |
52 | |
53 GURL service_url; // URL for service invocation. | |
54 string16 title; // The title of the service. | |
55 | |
56 // Disposition specifies the way in which a service is surfaced to the user. | |
57 // Current supported dispositions are declared in the |Disposition| enum. | |
58 Disposition disposition; | |
59 }; | |
60 | |
61 // Printing operator - helps gtest produce readable error messages. | |
62 WEBKIT_GLUE_EXPORT std::ostream& operator<<( | |
63 std::ostream& os, | |
64 const webkit_glue::WebIntentServiceData& intent); | |
65 | |
66 } // namespace webkit_glue | |
67 | |
68 #endif // CHROME_BROWSER_INTENTS_WEB_INTENT_SERVICE_DATA_H_ | |
OLD | NEW |