| 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 CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_ |
| 6 #define CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_ | 6 #define CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 // Set the icon image for the suggested extension with |id|. | 130 // Set the icon image for the suggested extension with |id|. |
| 131 void SetSuggestedExtensionIconWithId(const string16& id, | 131 void SetSuggestedExtensionIconWithId(const string16& id, |
| 132 const gfx::Image& image); | 132 const gfx::Image& image); |
| 133 | 133 |
| 134 // Set the picker to display the intent service with |url| inline. | 134 // Set the picker to display the intent service with |url| inline. |
| 135 void SetInlineDisposition(const GURL& url); | 135 void SetInlineDisposition(const GURL& url); |
| 136 | 136 |
| 137 // Returns true if the picker is currently displaying an inline service. | 137 // Returns true if the picker is currently displaying an inline service. |
| 138 bool IsInlineDisposition() const; | 138 bool IsInlineDisposition() const; |
| 139 | 139 |
| 140 // Returns true if there is still a pending request for suggestions from CWS. |
| 141 bool IsWaitingForSuggestions() const; |
| 142 |
| 143 // Set the "waiting for suggestions" status to |waiting| |
| 144 void SetWaitingForSuggestions(bool waiting); |
| 145 |
| 140 // Returns the url of the intent service that is being displayed inline, or | 146 // Returns the url of the intent service that is being displayed inline, or |
| 141 // GURL::EmptyGURL() if none. | 147 // GURL::EmptyGURL() if none. |
| 142 const GURL& inline_disposition_url() const { return inline_disposition_url_; } | 148 const GURL& inline_disposition_url() const { return inline_disposition_url_; } |
| 143 | 149 |
| 144 private: | 150 private: |
| 145 // Delete all elements in |installed_services_| and |suggested_extensions_|. | 151 // Delete all elements in |installed_services_| and |suggested_extensions_|. |
| 146 // Note that this method does not reset the observer. | 152 // Note that this method does not reset the observer. |
| 147 void DestroyAll(); | 153 void DestroyAll(); |
| 148 | 154 |
| 149 // A vector of all installed services in the picker. Each installed service | 155 // A vector of all installed services in the picker. Each installed service |
| (...skipping 14 matching lines...) Expand all Loading... |
| 164 // A cached copy of the action that instantiated the picker. | 170 // A cached copy of the action that instantiated the picker. |
| 165 string16 action_; | 171 string16 action_; |
| 166 | 172 |
| 167 // A cached copy of the type that instantiated the picker. | 173 // A cached copy of the type that instantiated the picker. |
| 168 string16 type_; | 174 string16 type_; |
| 169 | 175 |
| 170 // The non-empty url of the default service if the WebIntentsRegistry | 176 // The non-empty url of the default service if the WebIntentsRegistry |
| 171 // finds a default service matching the intent being dispatched. | 177 // finds a default service matching the intent being dispatched. |
| 172 GURL default_service_url_; | 178 GURL default_service_url_; |
| 173 | 179 |
| 180 // Indicates that there are still open requests to CWS. |
| 181 bool waiting_for_suggestions_; |
| 182 |
| 174 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerModel); | 183 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerModel); |
| 175 }; | 184 }; |
| 176 | 185 |
| 177 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_ | 186 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_ |
| OLD | NEW |