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.
5 #ifndef WEBKIT_GLUE_WEB_INTENT_SERVICE_DATA_H_
6 #define WEBKIT_GLUE_WEB_INTENT_SERVICE_DATA_H_
10 #include "base/string16.h"
11 #include "googleurl/src/gurl.h"
12 #include "webkit/glue/webkit_glue_export.h"
15 class WebIntentServiceInfo
;
18 namespace webkit_glue
{
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.
24 DISPOSITION_WINDOW
, // Open service inside a new window. (Default)
25 DISPOSITION_INLINE
, // Open service inside the picker UI window.
28 WebIntentServiceData();
29 WebIntentServiceData(const string16
& action
,
31 const string16
& scheme
,
32 const GURL
& service_url
,
33 const string16
& title
);
34 explicit WebIntentServiceData(const WebKit::WebIntentServiceInfo
& info
);
35 ~WebIntentServiceData();
37 bool operator==(const WebIntentServiceData
& other
) const;
39 void setDisposition(const string16
& disp
);
41 // |action|+|type| forms one type of unique service key. The other is
43 string16 action
; // Name of action provided by service.
44 string16 type
; // MIME type of data accepted by service.
46 // |scheme| forms one type of unique service key. The other is
47 // |action|+|type|. Note that this scheme is for purposes
48 // of matching intent services, not the scheme associated
49 // with the service_url.
50 string16 scheme
; // Protocol scheme for intent service matching.
52 GURL service_url
; // URL for service invocation.
53 string16 title
; // The title of the service.
55 // Disposition specifies the way in which a service is surfaced to the user.
56 // Current supported dispositions are declared in the |Disposition| enum.
57 Disposition disposition
;
60 // Printing operator - helps gtest produce readable error messages.
61 WEBKIT_GLUE_EXPORT
std::ostream
& operator<<(
63 const webkit_glue::WebIntentServiceData
& intent
);
65 } // namespace webkit_glue
67 #endif // CHROME_BROWSER_INTENTS_WEB_INTENT_SERVICE_DATA_H_