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_WEBUI_OPTIONS2_COOKIES_VIEW_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_COOKIES_VIEW_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_COOKIES_VIEW_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_COOKIES_VIEW_HANDLER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/cookies_tree_model.h" | 10 #include "chrome/browser/cookies_tree_model.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 void LoadChildren(const base::ListValue* args); | 57 void LoadChildren(const base::ListValue* args); |
58 | 58 |
59 // Get children nodes data and pass it to 'CookiesView.loadChildren' to | 59 // Get children nodes data and pass it to 'CookiesView.loadChildren' to |
60 // update the WebUI. | 60 // update the WebUI. |
61 void SendChildren(const CookieTreeNode* parent); | 61 void SendChildren(const CookieTreeNode* parent); |
62 | 62 |
63 // Set the context in which this view is used - regular cookies window or | 63 // Set the context in which this view is used - regular cookies window or |
64 // the apps cookies window. | 64 // the apps cookies window. |
65 void SetViewContext(const base::ListValue* args); | 65 void SetViewContext(const base::ListValue* args); |
66 | 66 |
| 67 // Reloads the CookiesTreeModel and passes the nodes to |
| 68 // 'CookiesView.loadChildren' to update the WebUI. |
| 69 void ReloadCookies(const base::ListValue* args); |
| 70 |
67 // Return the proper callback string, depending on whether the model is | 71 // Return the proper callback string, depending on whether the model is |
68 // in regular cookies mode or apps cookies mode. | 72 // in regular cookies mode or apps cookies mode. |
69 std::string GetCallback(std::string method, CookiesTreeModel* model); | 73 std::string GetCallback(std::string method, CookiesTreeModel* model); |
70 | 74 |
71 // Return the proper tree model, depending on the context in which the | 75 // Return the proper tree model, depending on the context in which the |
72 // view operates. | 76 // view operates. |
73 CookiesTreeModel* GetTreeModel(); | 77 CookiesTreeModel* GetTreeModel(); |
74 | 78 |
75 // The Cookies Tree model | 79 // The Cookies Tree model |
76 scoped_ptr<CookiesTreeModel> cookies_tree_model_; | 80 scoped_ptr<CookiesTreeModel> cookies_tree_model_; |
77 scoped_ptr<CookiesTreeModel> app_cookies_tree_model_; | 81 scoped_ptr<CookiesTreeModel> app_cookies_tree_model_; |
78 | 82 |
79 // Flag to indicate whether there is a batch update in progress. | 83 // Flag to indicate whether there is a batch update in progress. |
80 bool batch_update_; | 84 bool batch_update_; |
81 | 85 |
82 // A flag to indicate which view is active - the apps dialog or the regular | 86 // A flag to indicate which view is active - the apps dialog or the regular |
83 // cookies one. This will cause different JavaScript functions to be called. | 87 // cookies one. This will cause different JavaScript functions to be called. |
84 bool app_context_; | 88 bool app_context_; |
85 | 89 |
86 scoped_ptr<CookiesTreeModelUtil> model_util_; | 90 scoped_ptr<CookiesTreeModelUtil> model_util_; |
87 | 91 |
88 DISALLOW_COPY_AND_ASSIGN(CookiesViewHandler); | 92 DISALLOW_COPY_AND_ASSIGN(CookiesViewHandler); |
89 }; | 93 }; |
90 | 94 |
91 } // namespace options2 | 95 } // namespace options2 |
92 | 96 |
93 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_COOKIES_VIEW_HANDLER_H_ | 97 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_COOKIES_VIEW_HANDLER_H_ |
OLD | NEW |