Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(528)

Side by Side Diff: chrome/browser/views/options/cookies_view.h

Issue 650110: Teach the cookie tree view / model about appcaches. Not hooked up to real dat... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_VIEWS_OPTIONS_COOKIES_VIEW_H_ 5 #ifndef CHROME_BROWSER_VIEWS_OPTIONS_COOKIES_VIEW_H_
6 #define CHROME_BROWSER_VIEWS_OPTIONS_COOKIES_VIEW_H_ 6 #define CHROME_BROWSER_VIEWS_OPTIONS_COOKIES_VIEW_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "app/tree_model.h" 10 #include "app/tree_model.h"
11 #include "base/task.h" 11 #include "base/task.h"
12 #include "net/base/cookie_monster.h" 12 #include "net/base/cookie_monster.h"
13 #include "views/controls/button/button.h" 13 #include "views/controls/button/button.h"
14 #include "views/controls/tree/tree_view.h" 14 #include "views/controls/tree/tree_view.h"
15 #include "views/controls/textfield/textfield.h" 15 #include "views/controls/textfield/textfield.h"
16 #include "views/view.h" 16 #include "views/view.h"
17 #include "views/window/dialog_delegate.h" 17 #include "views/window/dialog_delegate.h"
18 #include "views/window/window.h" 18 #include "views/window/window.h"
19 19
20 namespace views { 20 namespace views {
21 21
22 class Label; 22 class Label;
23 class NativeButton; 23 class NativeButton;
24 24
25 } // namespace views 25 } // namespace views
26 26
27 27
28 class AppCacheInfoView;
28 class CookieInfoView; 29 class CookieInfoView;
29 class CookiesTreeModel; 30 class CookiesTreeModel;
30 class CookiesTreeView; 31 class CookiesTreeView;
31 class DatabaseInfoView; 32 class DatabaseInfoView;
32 class LocalStorageInfoView; 33 class LocalStorageInfoView;
33 class Profile; 34 class Profile;
34 class Timer; 35 class Timer;
35 36
36 37
37 class CookiesView : public TreeModelObserver, 38 class CookiesView : public TreeModelObserver,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 virtual void Layout(); 101 virtual void Layout();
101 virtual gfx::Size GetPreferredSize(); 102 virtual gfx::Size GetPreferredSize();
102 103
103 protected: 104 protected:
104 // views::View overrides: 105 // views::View overrides:
105 virtual void ViewHierarchyChanged(bool is_add, 106 virtual void ViewHierarchyChanged(bool is_add,
106 views::View* parent, 107 views::View* parent,
107 views::View* child); 108 views::View* child);
108 109
109 private: 110 private:
111 class InfoPanelView;
112
110 // Use the static factory method to show. 113 // Use the static factory method to show.
111 explicit CookiesView(Profile* profile); 114 explicit CookiesView(Profile* profile);
112 115
113 // Initialize the dialog contents and layout. 116 // Initialize the dialog contents and layout.
114 void Init(); 117 void Init();
115 118
116 // Resets the display to what it would be if there were no search query. 119 // Resets the display to what it would be if there were no search query.
117 void ResetSearchQuery(); 120 void ResetSearchQuery();
118 121
119 // Update the UI when there are no cookies. 122 // Update the UI when there are no cookies.
120 void UpdateForEmptyState(); 123 void UpdateForEmptyState();
121 124
122 // Update the UI when a cookie is selected.
123 void UpdateForCookieState();
124
125 // Update the UI when a database is selected.
126 void UpdateForDatabaseState();
127
128 // Update the UI when a local storage is selected.
129 void UpdateForLocalStorageState();
130
131 // Enable or disable the remove and remove all buttons. 125 // Enable or disable the remove and remove all buttons.
132 void UpdateRemoveButtonsState(); 126 void UpdateRemoveButtonsState();
133 127
134 // Updates view to be visible inside detailed_info_view_; 128 // Updates view to be visible inside detailed_info_view_;
135 void UpdateVisibleDetailedInfo(views::View* view); 129 void UpdateVisibleDetailedInfo(views::View* view);
136 130
137 // Assorted dialog controls 131 // Assorted dialog controls
138 views::Label* search_label_; 132 views::Label* search_label_;
139 views::Textfield* search_field_; 133 views::Textfield* search_field_;
140 views::NativeButton* clear_search_button_; 134 views::NativeButton* clear_search_button_;
141 views::Label* description_label_; 135 views::Label* description_label_;
142 CookiesTreeView* cookies_tree_; 136 CookiesTreeView* cookies_tree_;
137 InfoPanelView* info_panel_;
143 CookieInfoView* cookie_info_view_; 138 CookieInfoView* cookie_info_view_;
144 DatabaseInfoView* database_info_view_; 139 DatabaseInfoView* database_info_view_;
145 LocalStorageInfoView* local_storage_info_view_; 140 LocalStorageInfoView* local_storage_info_view_;
141 AppCacheInfoView* appcache_info_view_;
146 views::NativeButton* remove_button_; 142 views::NativeButton* remove_button_;
147 views::NativeButton* remove_all_button_; 143 views::NativeButton* remove_all_button_;
148 144
149 // The Cookies Tree model 145 // The Cookies Tree model
150 scoped_ptr<CookiesTreeModel> cookies_tree_model_; 146 scoped_ptr<CookiesTreeModel> cookies_tree_model_;
151 147
152 // The Profile for which Cookies are displayed 148 // The Profile for which Cookies are displayed
153 Profile* profile_; 149 Profile* profile_;
154 150
155 // A factory to construct Runnable Methods so that we can be called back to 151 // A factory to construct Runnable Methods so that we can be called back to
156 // re-evaluate the model after the search query string changes. 152 // re-evaluate the model after the search query string changes.
157 ScopedRunnableMethodFactory<CookiesView> search_update_factory_; 153 ScopedRunnableMethodFactory<CookiesView> search_update_factory_;
158 154
159 // Our containing window. If this is non-NULL there is a visible Cookies 155 // Our containing window. If this is non-NULL there is a visible Cookies
160 // window somewhere. 156 // window somewhere.
161 static views::Window* instance_; 157 static views::Window* instance_;
162 158
163 DISALLOW_COPY_AND_ASSIGN(CookiesView); 159 DISALLOW_COPY_AND_ASSIGN(CookiesView);
164 }; 160 };
165 161
166 #endif // CHROME_BROWSER_VIEWS_OPTIONS_COOKIES_VIEW_H_ 162 #endif // CHROME_BROWSER_VIEWS_OPTIONS_COOKIES_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/browser/views/database_info_view.cc ('k') | chrome/browser/views/options/cookies_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698