Chromium Code Reviews| Index: chrome/browser/ui/webui/options2/cookies_view_handler2.h |
| diff --git a/chrome/browser/ui/webui/options2/cookies_view_handler2.h b/chrome/browser/ui/webui/options2/cookies_view_handler2.h |
| index 19e41105477890c8b1e6ee8e6b5562b300621430..6db59714f9a24764d0e14b86fe94df63360f16e3 100644 |
| --- a/chrome/browser/ui/webui/options2/cookies_view_handler2.h |
| +++ b/chrome/browser/ui/webui/options2/cookies_view_handler2.h |
| @@ -39,6 +39,12 @@ class CookiesViewHandler : public OptionsPageUIHandler, |
| virtual void TreeModelEndBatch(CookiesTreeModel* model) OVERRIDE; |
| private: |
| + enum CookiesViewCallback { |
| + onTreeItemAdded, |
| + onTreeItemRemoved, |
| + loadChildren |
| + }; |
| + |
| // Creates the CookiesTreeModel if neccessary. |
| void EnsureCookiesTreeModelCreated(); |
| @@ -59,12 +65,30 @@ class CookiesViewHandler : public OptionsPageUIHandler, |
| // update the WebUI. |
| void SendChildren(CookieTreeNode* parent); |
| + // Set the context in which this view is used - regular cookies window or |
| + // the apps cookies window. |
| + void SetViewContext(const base::ListValue* args); |
| + |
| + // Return the proper callback string, depending on the context in which the |
|
Evan Stade
2012/06/27 04:53:00
"the context in which the view operates" is not a
nasko
2012/06/27 17:17:01
Done.
|
| + // view operates. |
| + const std::string GetCallback(CookiesViewCallback callback); |
|
Evan Stade
2012/06/27 04:53:00
const without ref is meaningless for return types.
nasko
2012/06/27 17:17:01
Done.
|
| + |
| + // Return the proper tree model, depending on the context in which the |
| + // view operates. |
| + CookiesTreeModel* GetTreeModel(); |
| + |
| // The Cookies Tree model |
| scoped_ptr<CookiesTreeModel> cookies_tree_model_; |
| + scoped_ptr<CookiesTreeModel> app_cookies_tree_model_; |
| // Flag to indicate whether there is a batch update in progress. |
| bool batch_update_; |
| + // Flag to indicate whether the view is used in the apps dialog context or |
| + // the regular cookies context. This will cause different callbacks into |
| + // JavaScript to be called. |
| + bool app_context_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(CookiesViewHandler); |
| }; |