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 CHROME_BROWSER_UI_INTENTS_WEB_INTENTS_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_INTENTS_WEB_INTENTS_MODEL_H_ |
6 #define CHROME_BROWSER_UI_INTENTS_WEB_INTENTS_MODEL_H_ | 6 #define CHROME_BROWSER_UI_INTENTS_WEB_INTENTS_MODEL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/intents/web_intents_registry.h" | 10 #include "chrome/browser/intents/web_intents_registry.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 string16 GetTreeNodeId(WebIntentsTreeNode* node); | 97 string16 GetTreeNodeId(WebIntentsTreeNode* node); |
98 WebIntentsTreeNode* GetTreeNode(std::string path_id); | 98 WebIntentsTreeNode* GetTreeNode(std::string path_id); |
99 void GetChildNodeList(WebIntentsTreeNode* parent, int start, int count, | 99 void GetChildNodeList(WebIntentsTreeNode* parent, int start, int count, |
100 base::ListValue* nodes); | 100 base::ListValue* nodes); |
101 void GetWebIntentsTreeNodeDictionary(const WebIntentsTreeNode& node, | 101 void GetWebIntentsTreeNodeDictionary(const WebIntentsTreeNode& node, |
102 base::DictionaryValue* dict); | 102 base::DictionaryValue* dict); |
103 | 103 |
104 virtual void OnIntentsQueryDone( | 104 virtual void OnIntentsQueryDone( |
105 WebIntentsRegistry::QueryID query_id, | 105 WebIntentsRegistry::QueryID query_id, |
106 const std::vector<WebIntentServiceData>& intents) OVERRIDE; | 106 const std::vector<webkit_glue::WebIntentServiceData>& services) OVERRIDE; |
107 | 107 |
108 private: | 108 private: |
109 // Loads the data model from the WebIntentsRegistry. | 109 // Loads the data model from the WebIntentsRegistry. |
110 // TODO(gbillock): need an observer on that to absorb async updates? | 110 // TODO(gbillock): need an observer on that to absorb async updates? |
111 void LoadModel(); | 111 void LoadModel(); |
112 | 112 |
113 // Do batch-specific notifies for updates coming from the LoadModel. | 113 // Do batch-specific notifies for updates coming from the LoadModel. |
114 void NotifyObserverBeginBatch(); | 114 void NotifyObserverBeginBatch(); |
115 void NotifyObserverEndBatch(); | 115 void NotifyObserverEndBatch(); |
116 | 116 |
117 // The backing registry. Weak pointer. | 117 // The backing registry. Weak pointer. |
118 WebIntentsRegistry* intents_registry_; | 118 WebIntentsRegistry* intents_registry_; |
119 | 119 |
120 // Separate list of observers that'll get batch updates. | 120 // Separate list of observers that'll get batch updates. |
121 ObserverList<Observer> intents_observer_list_; | 121 ObserverList<Observer> intents_observer_list_; |
122 | 122 |
123 // Batch update nesting level. Incremented to indicate that we're in | 123 // Batch update nesting level. Incremented to indicate that we're in |
124 // the middle of a batch update. | 124 // the middle of a batch update. |
125 int batch_update_; | 125 int batch_update_; |
126 }; | 126 }; |
127 | 127 |
128 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENTS_MODEL_H_ | 128 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENTS_MODEL_H_ |
OLD | NEW |