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

Side by Side Diff: chrome/browser/ui/views/clear_browsing_data.h

Issue 5964008: Add UI to the Clear Browsing Data dialog to remove Flash LSO data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 9 years, 11 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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_VIEWS_CLEAR_BROWSING_DATA_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_CLEAR_BROWSING_DATA_H_
6 #define CHROME_BROWSER_UI_VIEWS_CLEAR_BROWSING_DATA_H_ 6 #define CHROME_BROWSER_UI_VIEWS_CLEAR_BROWSING_DATA_H_
7 #pragma once 7 #pragma once
8 8
9 #include "app/combobox_model.h" 9 #include "app/combobox_model.h"
10 #include "chrome/browser/browsing_data_remover.h" 10 #include "chrome/browser/browsing_data_remover.h"
11 #include "chrome/browser/plugin_data_remover_helper.h"
12 #include "chrome/common/notification_observer.h"
11 #include "views/controls/button/button.h" 13 #include "views/controls/button/button.h"
12 #include "views/controls/combobox/combobox.h" 14 #include "views/controls/combobox/combobox.h"
13 #include "views/controls/label.h" 15 #include "views/controls/label.h"
14 #include "views/controls/link.h" 16 #include "views/controls/link.h"
15 #include "views/view.h" 17 #include "views/view.h"
16 #include "views/window/dialog_delegate.h" 18 #include "views/window/dialog_delegate.h"
17 19
18 namespace views { 20 namespace views {
19 class Checkbox; 21 class Checkbox;
20 class Label; 22 class Label;
(...skipping 10 matching lines...) Expand all
31 // dialog that allows the user to select what to delete (history, downloads, 33 // dialog that allows the user to select what to delete (history, downloads,
32 // etc). 34 // etc).
33 // 35 //
34 //////////////////////////////////////////////////////////////////////////////// 36 ////////////////////////////////////////////////////////////////////////////////
35 class ClearBrowsingDataView : public views::View, 37 class ClearBrowsingDataView : public views::View,
36 public views::DialogDelegate, 38 public views::DialogDelegate,
37 public views::ButtonListener, 39 public views::ButtonListener,
38 public ComboboxModel, 40 public ComboboxModel,
39 public views::Combobox::Listener, 41 public views::Combobox::Listener,
40 public BrowsingDataRemover::Observer, 42 public BrowsingDataRemover::Observer,
41 public views::LinkController { 43 public views::LinkController,
44 public NotificationObserver {
42 public: 45 public:
43 explicit ClearBrowsingDataView(Profile* profile); 46 explicit ClearBrowsingDataView(Profile* profile);
44 virtual ~ClearBrowsingDataView(void); 47 virtual ~ClearBrowsingDataView(void);
45 48
46 // Initialize the controls on the dialog. 49 // Initialize the controls on the dialog.
47 void Init(); 50 void Init();
48 51
49 // Overridden from views::View: 52 // Overridden from views::View:
50 virtual gfx::Size GetPreferredSize(); 53 virtual gfx::Size GetPreferredSize();
51 virtual void Layout(); 54 virtual void Layout();
(...skipping 21 matching lines...) Expand all
73 virtual int GetItemCount(); 76 virtual int GetItemCount();
74 virtual string16 GetItemAt(int index); 77 virtual string16 GetItemAt(int index);
75 78
76 // Overridden from views::Combobox::Listener: 79 // Overridden from views::Combobox::Listener:
77 virtual void ItemChanged(views::Combobox* sender, int prev_index, 80 virtual void ItemChanged(views::Combobox* sender, int prev_index,
78 int new_index); 81 int new_index);
79 82
80 // Overridden from views::ButtonListener: 83 // Overridden from views::ButtonListener:
81 virtual void ButtonPressed(views::Button* sender, const views::Event& event); 84 virtual void ButtonPressed(views::Button* sender, const views::Event& event);
82 85
83 // Overriden from views::LinkController: 86 // Overridden from views::LinkController:
84 virtual void LinkActivated(views::Link* source, int event_flags); 87 virtual void LinkActivated(views::Link* source, int event_flags);
85 88
89 // Overridden from NotificationObserver:
90 virtual void Observe(NotificationType type,
91 const NotificationSource& source,
92 const NotificationDetails& details);
93
86 private: 94 private:
87 // Adds a new check-box as a child to the view. 95 // Adds a new check-box as a child to the view.
88 views::Checkbox* AddCheckbox(const std::wstring& text, bool checked); 96 views::Checkbox* AddCheckbox(const std::wstring& text, bool checked);
89 97
98 // Updates the state of the "Delete plug-in data" checkbox based on whether
99 // deleting plug-in LSO data is supported.
100 void UpdateDelLSODataState();
101
90 // Sets the controls on the UI to be enabled/disabled depending on whether we 102 // Sets the controls on the UI to be enabled/disabled depending on whether we
91 // have a delete operation in progress or not. 103 // have a delete operation in progress.
92 void UpdateControlEnabledState(); 104 void UpdateControlState();
93 105
94 // Starts the process of deleting the browsing data depending on what the 106 // Starts the process of deleting the browsing data depending on what the
95 // user selected. 107 // user selected.
96 void OnDelete(); 108 void OnDelete();
97 109
98 // Callback from BrowsingDataRemover. Closes the dialog. 110 // Callback from BrowsingDataRemover. Closes the dialog.
99 virtual void OnBrowsingDataRemoverDone(); 111 virtual void OnBrowsingDataRemoverDone();
100 112
101 // UI elements we add to the parent view. 113 // UI elements we add to the parent view.
102 views::View* throbber_view_; 114 views::View* throbber_view_;
103 views::Throbber* throbber_; 115 views::Throbber* throbber_;
104 views::Label* status_label_; 116 views::Label* status_label_;
105 // Other UI elements. 117 // Other UI elements.
106 views::Label* delete_all_label_; 118 views::Label* delete_all_label_;
107 views::Checkbox* del_history_checkbox_; 119 views::Checkbox* del_history_checkbox_;
108 views::Checkbox* del_downloads_checkbox_; 120 views::Checkbox* del_downloads_checkbox_;
109 views::Checkbox* del_cache_checkbox_; 121 views::Checkbox* del_cache_checkbox_;
110 views::Checkbox* del_cookies_checkbox_; 122 views::Checkbox* del_cookies_checkbox_;
111 views::Checkbox* del_passwords_checkbox_; 123 views::Checkbox* del_passwords_checkbox_;
124 views::Checkbox* del_lso_data_checkbox_;
112 views::Checkbox* del_form_data_checkbox_; 125 views::Checkbox* del_form_data_checkbox_;
113 views::Label* time_period_label_; 126 views::Label* time_period_label_;
114 views::Combobox* time_period_combobox_; 127 views::Combobox* time_period_combobox_;
115 128
116 // Used to signal enabled/disabled state for controls in the UI. 129 // Used to signal enabled/disabled state for controls in the UI.
117 bool delete_in_progress_; 130 bool delete_in_progress_;
118 131
119 Profile* profile_; 132 Profile* profile_;
120 133
134 PluginDataRemoverHelper del_lso_data_enabled_;
135
121 // If non-null it means removal is in progress. BrowsingDataRemover takes care 136 // If non-null it means removal is in progress. BrowsingDataRemover takes care
122 // of deleting itself when done. 137 // of deleting itself when done.
123 BrowsingDataRemover* remover_; 138 BrowsingDataRemover* remover_;
124 139
125 DISALLOW_COPY_AND_ASSIGN(ClearBrowsingDataView); 140 DISALLOW_COPY_AND_ASSIGN(ClearBrowsingDataView);
126 }; 141 };
127 142
128 #endif // CHROME_BROWSER_UI_VIEWS_CLEAR_BROWSING_DATA_H_ 143 #endif // CHROME_BROWSER_UI_VIEWS_CLEAR_BROWSING_DATA_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/clear_browsing_data_controller_unittest.mm ('k') | chrome/browser/ui/views/clear_browsing_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698