diff options
author | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-22 19:39:21 +0000 |
---|---|---|
committer | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-22 19:39:21 +0000 |
commit | 41cf8020fe10d9949772f58af8504d768edd33a4 (patch) | |
tree | a9a291307dfe802c0aeddf7c5434102778d27427 /chrome/browser/cookies_table_model.h | |
parent | c535a312073f7fc4eaed7e5efa3d0ef3df2e1dce (diff) | |
download | chromium_src-41cf8020fe10d9949772f58af8504d768edd33a4.zip chromium_src-41cf8020fe10d9949772f58af8504d768edd33a4.tar.gz chromium_src-41cf8020fe10d9949772f58af8504d768edd33a4.tar.bz2 |
Gtk cookie manager part 1.
(Doesn't display cookie details, otherwise working.)
BUG=11507
TEST=All cookie manager functions should work as expected, other than viewing the cookie details.
Review URL: http://codereview.chromium.org/159187
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21307 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cookies_table_model.h')
-rw-r--r-- | chrome/browser/cookies_table_model.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/chrome/browser/cookies_table_model.h b/chrome/browser/cookies_table_model.h new file mode 100644 index 0000000..2b69849 --- /dev/null +++ b/chrome/browser/cookies_table_model.h @@ -0,0 +1,58 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_COOKIES_TABLE_MODEL_H_ +#define CHROME_BROWSER_COOKIES_TABLE_MODEL_H_ + +#include <string> +#include <vector> + +#include "app/table_model.h" +#include "net/base/cookie_monster.h" + +class Profile; + +class CookiesTableModel : public TableModel { + public: + explicit CookiesTableModel(Profile* profile); + virtual ~CookiesTableModel() {} + + // Returns information about the Cookie at the specified index. + std::string GetDomainAt(int index); + net::CookieMonster::CanonicalCookie& GetCookieAt(int index); + + // Remove the specified cookies from the Cookie Monster and update the view. + void RemoveCookies(int start_index, int remove_count); + void RemoveAllShownCookies(); + + // TableModel methods. + virtual int RowCount(); + virtual std::wstring GetText(int row, int column_id); + virtual SkBitmap GetIcon(int row); + virtual int CompareValues(int row1, int row2, int column_id); + virtual void SetObserver(TableModelObserver* observer); + + // Filter the cookies to only display matched results. + void UpdateSearchResults(const std::wstring& filter); + + private: + void LoadCookies(); + void DoFilter(); + + std::wstring filter_; + + // The profile from which this model sources cookies. + Profile* profile_; + + typedef net::CookieMonster::CookieList CookieList; + typedef std::vector<net::CookieMonster::CookieListPair*> CookiePtrList; + CookieList all_cookies_; + CookiePtrList shown_cookies_; + + TableModelObserver* observer_; + + DISALLOW_COPY_AND_ASSIGN(CookiesTableModel); +}; + +#endif // CHROME_BROWSER_COOKIES_TABLE_MODEL_H_ |