| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_COOKIES_TREE_MODEL_H_ | 5 #ifndef CHROME_BROWSER_COOKIES_TREE_MODEL_H_ |
| 6 #define CHROME_BROWSER_COOKIES_TREE_MODEL_H_ | 6 #define CHROME_BROWSER_COOKIES_TREE_MODEL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // Returns the index of the icon to use for |node|. Return -1 to use the | 179 // Returns the index of the icon to use for |node|. Return -1 to use the |
| 180 // default icon. The index is relative to the list of icons returned from | 180 // default icon. The index is relative to the list of icons returned from |
| 181 // GetIcons. | 181 // GetIcons. |
| 182 virtual int GetIconIndex(TreeModelNode* node); | 182 virtual int GetIconIndex(TreeModelNode* node); |
| 183 | 183 |
| 184 // CookiesTreeModel methods: | 184 // CookiesTreeModel methods: |
| 185 void DeleteCookie(const net::CookieMonster::CookieListPair& cookie); | 185 void DeleteCookie(const net::CookieMonster::CookieListPair& cookie); |
| 186 void DeleteAllCookies(); | 186 void DeleteAllCookies(); |
| 187 void DeleteCookieNode(CookieTreeNode* cookie_node); | 187 void DeleteCookieNode(CookieTreeNode* cookie_node); |
| 188 | 188 |
| 189 // Filter the origins to only display matched results. |
| 190 void UpdateSearchResults(const std::wstring& filter); |
| 191 |
| 189 private: | 192 private: |
| 190 enum CookieIconIndex { | 193 enum CookieIconIndex { |
| 191 ORIGIN = 0, | 194 ORIGIN = 0, |
| 192 COOKIE = 1 | 195 COOKIE = 1 |
| 193 }; | 196 }; |
| 194 typedef net::CookieMonster::CookieList CookieList; | 197 typedef net::CookieMonster::CookieList CookieList; |
| 195 typedef std::vector<net::CookieMonster::CookieListPair*> CookiePtrList; | 198 typedef std::vector<net::CookieMonster::CookieListPair*> CookiePtrList; |
| 196 | 199 |
| 197 void LoadCookies(); | 200 void LoadCookies(); |
| 201 void LoadCookiesWithFilter(const std::wstring& filter); |
| 198 | 202 |
| 199 // The profile from which this model sources cookies. | 203 // The profile from which this model sources cookies. |
| 200 Profile* profile_; | 204 Profile* profile_; |
| 201 CookieList all_cookies_; | 205 CookieList all_cookies_; |
| 202 | 206 |
| 203 DISALLOW_COPY_AND_ASSIGN(CookiesTreeModel); | 207 DISALLOW_COPY_AND_ASSIGN(CookiesTreeModel); |
| 204 }; | 208 }; |
| 205 | 209 |
| 206 #endif // CHROME_BROWSER_COOKIES_TREE_MODEL_H_ | 210 #endif // CHROME_BROWSER_COOKIES_TREE_MODEL_H_ |
| OLD | NEW |