OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/string16.h" | 9 #include "base/string16.h" |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
11 #include <iosfwd> | 11 #include <iosfwd> |
12 | 12 |
13 // Describes the relevant elements of a WebIntent service. | 13 // Describes the relevant elements of a WebIntent service. |
14 struct WebIntentServiceData { | 14 struct WebIntentServiceData { |
15 // An intents disposition determines which context the service is opened in. | 15 // An intents disposition determines which context the service is opened in. |
16 enum Disposition { | 16 enum Disposition { |
17 DISPOSITION_WINDOW, // Open service inside a new window. (Default) | 17 DISPOSITION_WINDOW, // Open service inside a new window. (Default) |
18 DISPOSITION_INLINE, // Open service inside the picker UI window. | 18 DISPOSITION_INLINE, // Open service inside the picker UI window. |
19 }; | 19 }; |
20 | 20 |
21 WebIntentServiceData(); | 21 WebIntentServiceData(); |
22 WebIntentServiceData(const GURL& service_url, | 22 WebIntentServiceData(const GURL& service_url, |
23 const string16& action, | 23 const string16& action, |
24 const string16& type, | 24 const string16& type, |
25 const string16& title); | 25 const string16& title); |
26 ~WebIntentServiceData(); | 26 ~WebIntentServiceData(); |
27 | 27 |
28 bool operator==(const WebIntentServiceData& other) const; | 28 bool operator==(const WebIntentServiceData& other) const; |
29 | 29 |
| 30 void setDisposition(const string16& disp); |
| 31 |
30 GURL service_url; // URL for service invocation. | 32 GURL service_url; // URL for service invocation. |
31 string16 action; // Name of action provided by service. | 33 string16 action; // Name of action provided by service. |
32 string16 type; // MIME type of data accepted by service. | 34 string16 type; // MIME type of data accepted by service. |
33 string16 title; // The title of the service. | 35 string16 title; // The title of the service. |
34 Disposition disposition; // The context the service is opened in. | 36 Disposition disposition; // The context the service is opened in. |
35 }; | 37 }; |
36 | 38 |
37 // Printing operator - helps gtest produce readable error messages. | 39 // Printing operator - helps gtest produce readable error messages. |
38 std::ostream& operator<<(std::ostream& os, const WebIntentServiceData& intent); | 40 std::ostream& operator<<(std::ostream& os, const WebIntentServiceData& intent); |
39 | 41 |
40 #endif // CHROME_BROWSER_INTENTS_WEB_INTENT_SERVICE_DATA_H_ | 42 #endif // CHROME_BROWSER_INTENTS_WEB_INTENT_SERVICE_DATA_H_ |
OLD | NEW |