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