diff options
author | bulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-25 13:50:48 +0000 |
---|---|---|
committer | bulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-25 13:50:48 +0000 |
commit | 8f9aefdd9324680937c83b2137ecba8584322245 (patch) | |
tree | 7ace3e1ab52d41b24f8f268c8e29592253019ac9 /chrome/browser/views/options/cookies_view.h | |
parent | 099fdcd5ff79ae6815f052060a605ad9a3454ad5 (diff) | |
download | chromium_src-8f9aefdd9324680937c83b2137ecba8584322245.zip chromium_src-8f9aefdd9324680937c83b2137ecba8584322245.tar.gz chromium_src-8f9aefdd9324680937c83b2137ecba8584322245.tar.bz2 |
Adds local storage nodes to cookie tree model and cookies view.
BUG=none
TEST=The show cookie dialog box should have a new node "local storage" when appropriate. When selected, it should display details of local storage (name, size on disk, last modified) in the details frame.
Review URL: http://codereview.chromium.org/523139
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37001 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/options/cookies_view.h')
-rw-r--r-- | chrome/browser/views/options/cookies_view.h | 57 |
1 files changed, 56 insertions, 1 deletions
diff --git a/chrome/browser/views/options/cookies_view.h b/chrome/browser/views/options/cookies_view.h index d7c1b23..91d6cf4a 100644 --- a/chrome/browser/views/options/cookies_view.h +++ b/chrome/browser/views/options/cookies_view.h @@ -8,6 +8,7 @@ #include <string> #include "base/task.h" +#include "chrome/browser/browsing_data_local_storage_helper.h" #include "net/base/cookie_monster.h" #include "views/controls/button/button.h" #include "views/controls/tree/tree_view.h" @@ -24,9 +25,11 @@ class NativeButton; } // namespace views +class BrowsingDataLocalStorageHelper; class CookieInfoView; class CookiesTreeModel; class CookiesTreeView; +class LocalStorageInfoView; class Profile; class Timer; @@ -96,13 +99,23 @@ class CookiesView : public views::View, // Update the UI when there are no cookies. void UpdateForEmptyState(); + // Update the UI when a cookie is selected. + void UpdateForCookieState(); + + // Update the UI when a local storage is selected. + void UpdateForLocalStorageState(); + + // Updates view to be visible inside detailed_info_view_; + void UpdateVisibleDetailedInfo(views::View* view); + // Assorted dialog controls views::Label* search_label_; views::Textfield* search_field_; views::NativeButton* clear_search_button_; views::Label* description_label_; CookiesTreeView* cookies_tree_; - CookieInfoView* info_view_; + CookieInfoView* cookie_info_view_; + LocalStorageInfoView* local_storage_info_view_; views::NativeButton* remove_button_; views::NativeButton* remove_all_button_; @@ -172,4 +185,46 @@ class CookieInfoView : public views::View { DISALLOW_COPY_AND_ASSIGN(CookieInfoView); }; +/////////////////////////////////////////////////////////////////////////////// +// LocalStorageInfoView +// +// Responsible for displaying a tabular grid of Local Storage information. +class LocalStorageInfoView : public views::View { + public: + LocalStorageInfoView(); + virtual ~LocalStorageInfoView(); + + // Update the display from the specified Local Storage info. + void SetLocalStorageInfo( + const BrowsingDataLocalStorageHelper::LocalStorageInfo& + local_storage_info); + + // Clears the cookie display to indicate that no or multiple local storages + // are selected. + void ClearLocalStorageDisplay(); + + // Enables or disables the local storate property text fields. + void EnableLocalStorageDisplay(bool enabled); + + protected: + // views::View overrides: + virtual void ViewHierarchyChanged( + bool is_add, views::View* parent, views::View* child); + + private: + // Set up the view layout + void Init(); + + // Individual property labels + views::Label* origin_label_; + views::Textfield* origin_value_field_; + views::Label* size_label_; + views::Textfield* size_value_field_; + views::Label* last_modified_label_; + views::Textfield* last_modified_value_field_; + + DISALLOW_COPY_AND_ASSIGN(LocalStorageInfoView); +}; + + #endif // CHROME_BROWSER_VIEWS_OPTIONS_COOKIES_VIEW_H_ |