Chromium Code Reviews| Index: chrome/browser/ui/intents/web_intents_model.h |
| diff --git a/chrome/browser/ui/intents/web_intents_model.h b/chrome/browser/ui/intents/web_intents_model.h |
| index 3ded493ce765529e80b932fb806eb6656d345f35..308eeaf8f145aebc883cc98700559d86a0cb653f 100644 |
| --- a/chrome/browser/ui/intents/web_intents_model.h |
| +++ b/chrome/browser/ui/intents/web_intents_model.h |
| @@ -5,12 +5,11 @@ |
| #ifndef CHROME_BROWSER_UI_INTENTS_WEB_INTENTS_MODEL_H_ |
| #define CHROME_BROWSER_UI_INTENTS_WEB_INTENTS_MODEL_H_ |
| +#include "base/basictypes.h" |
| #include "base/values.h" |
| -#include "chrome/browser/intents/web_intents_registry.h" |
| #include "ui/base/models/tree_node_model.h" |
| class WebIntentsRegistry; |
| -struct DefaultWebIntentService; |
| // The tree structure is a TYPE_ROOT node with title="", |
| // children are TYPE_ORIGIN nodes with title=origin, whose |
| @@ -19,17 +18,16 @@ struct DefaultWebIntentService; |
| // services. |
| class WebIntentsTreeNode : public ui::TreeNode<WebIntentsTreeNode> { |
| public: |
| - WebIntentsTreeNode(); |
| - explicit WebIntentsTreeNode(const string16& title); |
| - |
| - virtual ~WebIntentsTreeNode(); |
| - |
| enum NodeType { |
| TYPE_ROOT, |
| TYPE_ORIGIN, |
| TYPE_SERVICE, |
| }; |
| + WebIntentsTreeNode(); |
| + explicit WebIntentsTreeNode(const string16& title); |
| + virtual ~WebIntentsTreeNode(); |
| + |
| NodeType Type() const { return type_; } |
| protected: |
| @@ -39,6 +37,8 @@ class WebIntentsTreeNode : public ui::TreeNode<WebIntentsTreeNode> { |
| private: |
| NodeType type_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(WebIntentsTreeNode); |
| }; |
| // Tree node representing particular services presented by an origin. |
| @@ -55,11 +55,13 @@ class ServiceTreeNode : public WebIntentsTreeNode { |
| bool IsBlocked() const { return blocked_; } |
| bool IsDisabled() const { return disabled_; } |
| - void SetServiceName(string16 name) { service_name_ = name; } |
| - void SetServiceUrl(string16 url) { service_url_ = url; } |
| - void SetIconUrl(string16 url) { icon_url_ = url; } |
| - void SetAction(string16 action) { action_ = action; } |
| - void AddType(string16 type) { types_.Append(Value::CreateStringValue(type)); } |
| + void SetServiceName(const string16& name) { service_name_ = name; } |
| + void SetServiceUrl(const string16& url) { service_url_ = url; } |
| + void SetIconUrl(const string16& url) { icon_url_ = url; } |
| + void SetAction(const string16& action) { action_ = action; } |
| + void AddType(const string16& type) { |
| + types_.Append(base::Value::CreateStringValue(type)); |
| + } |
| void SetBlocked(bool blocked) { blocked_ = blocked; } |
| void SetDisabled(bool disabled) { disabled_ = disabled; } |
| @@ -73,6 +75,8 @@ class ServiceTreeNode : public WebIntentsTreeNode { |
| // TODO(gbillock): these are kind of a placeholder for exceptions data. |
| bool blocked_; |
| bool disabled_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ServiceTreeNode); |
| }; |
| // UI-backing tree model of the data in the WebIntentsRegistry. |
| @@ -83,6 +87,8 @@ class WebIntentsModel : public ui::TreeNodeModel<WebIntentsTreeNode> { |
| // observers for every item added. |
| class Observer : public ui::TreeModelObserver { |
| public: |
| + virtual ~Observer() {} |
|
groby-ooo-7-16
2012/10/09 01:58:22
nit: Technically not needed, since ui::TreeModelOb
tfarina
2012/10/09 02:00:33
Removed.
|
| + |
| virtual void TreeModelBeginBatch(WebIntentsModel* model) {} |
| virtual void TreeModelEndBatch(WebIntentsModel* model) {} |
| }; |
| @@ -94,8 +100,10 @@ class WebIntentsModel : public ui::TreeNodeModel<WebIntentsTreeNode> { |
| void RemoveWebIntentsTreeObserver(Observer* observer); |
| string16 GetTreeNodeId(WebIntentsTreeNode* node); |
| - WebIntentsTreeNode* GetTreeNode(std::string path_id); |
| - void GetChildNodeList(WebIntentsTreeNode* parent, int start, int count, |
| + WebIntentsTreeNode* GetTreeNode(const std::string& path_id); |
| + void GetChildNodeList(WebIntentsTreeNode* parent, |
| + int start, |
| + int count, |
| base::ListValue* nodes); |
| void GetWebIntentsTreeNodeDictionary(const WebIntentsTreeNode& node, |
| base::DictionaryValue* dict); |
| @@ -124,6 +132,8 @@ class WebIntentsModel : public ui::TreeNodeModel<WebIntentsTreeNode> { |
| // Batch update nesting level. Incremented to indicate that we're in |
| // the middle of a batch update. |
| int batch_update_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(WebIntentsModel); |
| }; |
| #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENTS_MODEL_H_ |