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

Side by Side Diff: chrome/browser/ui/webui/options/website_settings_handler.h

Issue 493383004: Add a button to clear local storage for a given origin to Website Settings dialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Discarding is go. Created 6 years, 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_WEBUI_OPTIONS_WEBSITE_SETTINGS_HANDLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_WEBSITE_SETTINGS_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_WEBSITE_SETTINGS_HANDLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_WEBSITE_SETTINGS_HANDLER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // |args| is the name of the setting and the new value. 59 // |args| is the name of the setting and the new value.
60 void HandleSetOriginPermission(const base::ListValue* args); 60 void HandleSetOriginPermission(const base::ListValue* args);
61 61
62 // Update the page with all origins that are using local storage. 62 // Update the page with all origins that are using local storage.
63 void HandleUpdateLocalStorage(const base::ListValue* args); 63 void HandleUpdateLocalStorage(const base::ListValue* args);
64 64
65 // Show the single site edit view if the given URL is valid. 65 // Show the single site edit view if the given URL is valid.
66 // |args| is the URL. 66 // |args| is the URL.
67 void HandleMaybeShowEditPage(const base::ListValue* args); 67 void HandleMaybeShowEditPage(const base::ListValue* args);
68 68
69 // Deletes the local storage and repopulates the page.
70 void HandleDeleteLocalStorage(const base::ListValue* args);
71
72 // Closes all tabs and app windows which have the same origin as the selected
73 // page.
74 void HandleStopOrigin(const base::ListValue* args);
75
69 // Callback method to be invoked when fetching the data is complete. 76 // Callback method to be invoked when fetching the data is complete.
70 void OnLocalStorageFetched(const LocalStorageList& storage); 77 void OnLocalStorageFetched(const LocalStorageList& storage);
71 78
72 // Get all origins with Content Settings for the last given content setting, 79 // Get all origins with Content Settings for the last given content setting,
73 // filter them by |last_filter_|, and update the page. 80 // filter them by |last_filter_|, and update the page.
74 void UpdateOrigins(); 81 void UpdateOrigins();
75 82
76 // Get all origins with local storage usage, filter them by |last_filter_|, 83 // Get all origins with local storage usage, filter them by |last_filter_|,
77 // and update the page. 84 // and update the page.
78 void UpdateLocalStorage(); 85 void UpdateLocalStorage();
79 86
87 // Kill all tabs and app windows which have the same origin as |site_url|.
88 void StopOrigin(const GURL& site_url);
89
90 // Delete all of the local storage for the |site_url|.
91 void DeleteLocalStorage(const GURL& site_url);
92
80 // Populates the single site edit view with the permissions and local storage 93 // Populates the single site edit view with the permissions and local storage
81 // usage for a given |site_url|. 94 // usage for a given |site_url|. If |show_page| is true, it raises a new
82 void GetInfoForOrigin(const GURL& site_url); 95 // single site edit view.
96 void GetInfoForOrigin(const GURL& site_url, bool show_page);
83 97
84 // Updates the page with the last settings used. 98 // Updates the page with the last settings used.
85 void Update(); 99 void Update();
86 100
87 std::string last_setting_; 101 std::string last_setting_;
88 std::string last_filter_; 102 std::string last_filter_;
89 GURL last_site_; 103 GURL last_site_;
90 scoped_refptr<BrowsingDataLocalStorageHelper> local_storage_; 104 scoped_refptr<BrowsingDataLocalStorageHelper> local_storage_;
91 LocalStorageList local_storage_list_; 105 LocalStorageList local_storage_list_;
92 106
93 // Observer to watch for content settings changes. 107 // Observer to watch for content settings changes.
94 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; 108 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_;
95 109
96 base::WeakPtrFactory<WebsiteSettingsHandler> weak_ptr_factory_; 110 base::WeakPtrFactory<WebsiteSettingsHandler> weak_ptr_factory_;
97 111
98 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsHandler); 112 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsHandler);
99 }; 113 };
100 114
101 } // namespace options 115 } // namespace options
102 116
103 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_WEBSITE_SETTINGS_HANDLER_H_ 117 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_WEBSITE_SETTINGS_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698