| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // Return the suggested extension at |index|. | 109 // Return the suggested extension at |index|. |
| 110 const SuggestedExtension& GetSuggestedExtensionAt(size_t index) const; | 110 const SuggestedExtension& GetSuggestedExtensionAt(size_t index) const; |
| 111 | 111 |
| 112 // Return the number of suggested extensions. | 112 // Return the number of suggested extensions. |
| 113 size_t GetSuggestedExtensionCount() const; | 113 size_t GetSuggestedExtensionCount() const; |
| 114 | 114 |
| 115 // Set the icon image for the suggested extension with |id|. | 115 // Set the icon image for the suggested extension with |id|. |
| 116 void SetSuggestedExtensionIconWithId(const string16& id, | 116 void SetSuggestedExtensionIconWithId(const string16& id, |
| 117 const gfx::Image& image); | 117 const gfx::Image& image); |
| 118 | 118 |
| 119 // Set the picker to display the intent service at |index| inline. | 119 // Set the picker to display the intent service with |url| inline. |
| 120 void SetInlineDisposition(size_t index); | 120 void SetInlineDisposition(const GURL& url); |
| 121 | 121 |
| 122 // Returns true if the picker is currently displaying an inline service. | 122 // Returns true if the picker is currently displaying an inline service. |
| 123 bool IsInlineDisposition() const; | 123 bool IsInlineDisposition() const; |
| 124 | 124 |
| 125 // Returns the index of the intent service that is being displayed inline, or | 125 // Returns the url of the intent service that is being displayed inline, or |
| 126 // std::string::npos if none. | 126 // GURL::EmptyGURL() if none. |
| 127 size_t inline_disposition_index() const { return inline_disposition_index_; } | 127 GURL inline_disposition_url() const { return inline_disposition_url_; } |
| 128 | 128 |
| 129 private: | 129 private: |
| 130 // Delete all elements in |installed_services_| and |suggested_extensions_|. | 130 // Delete all elements in |installed_services_| and |suggested_extensions_|. |
| 131 // Note that this method does not reset the observer. | 131 // Note that this method does not reset the observer. |
| 132 void DestroyAll(); | 132 void DestroyAll(); |
| 133 | 133 |
| 134 // A vector of all installed services in the picker. Each installed service | 134 // A vector of all installed services in the picker. Each installed service |
| 135 // is owned by this model. | 135 // is owned by this model. |
| 136 std::vector<InstalledService*> installed_services_; | 136 std::vector<InstalledService*> installed_services_; |
| 137 | 137 |
| 138 // A vector of all suggested extensions in the picker. Each element is owned | 138 // A vector of all suggested extensions in the picker. Each element is owned |
| 139 // by this model. | 139 // by this model. |
| 140 std::vector<SuggestedExtension*> suggested_extensions_; | 140 std::vector<SuggestedExtension*> suggested_extensions_; |
| 141 | 141 |
| 142 // The observer to send notifications to, or NULL if none. | 142 // The observer to send notifications to, or NULL if none. |
| 143 WebIntentPickerModelObserver* observer_; | 143 WebIntentPickerModelObserver* observer_; |
| 144 | 144 |
| 145 // The index of the intent service that is being displayed inline, or | 145 // The url of the intent service that is being displayed inline, or |
| 146 // std::string::npos if none. | 146 // GURL::EmptyGURL() if none. |
| 147 size_t inline_disposition_index_; | 147 GURL inline_disposition_url_; |
| 148 | 148 |
| 149 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerModel); | 149 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerModel); |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_ | 152 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_ |
| OLD | NEW |