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