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

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

Issue 543983005: Add a dropdown to change the default content setting to the Website Settings page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix CrOS build error. Created 6 years, 3 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // |args| is the URL. 71 // |args| is the URL.
72 void HandleMaybeShowEditPage(const base::ListValue* args); 72 void HandleMaybeShowEditPage(const base::ListValue* args);
73 73
74 // Get all origins that have used power, filter them by |last_filter_|, and 74 // Get all origins that have used power, filter them by |last_filter_|, and
75 // update the page. 75 // update the page.
76 void HandleUpdateBatteryUsage(const base::ListValue* args); 76 void HandleUpdateBatteryUsage(const base::ListValue* args);
77 77
78 // Deletes the local storage and repopulates the page. 78 // Deletes the local storage and repopulates the page.
79 void HandleDeleteLocalStorage(const base::ListValue* args); 79 void HandleDeleteLocalStorage(const base::ListValue* args);
80 80
81 // Populates the default setting drop down on the single site edit page.
82 void HandleUpdateDefaultSetting(const base::ListValue* args);
83
84 // Sets the default setting for the lat used content setting to |args|.
85 void HandleSetDefaultSetting(const base::ListValue* args);
86
81 // Closes all tabs and app windows which have the same origin as the selected 87 // Closes all tabs and app windows which have the same origin as the selected
82 // page. 88 // page.
83 void HandleStopOrigin(const base::ListValue* args); 89 void HandleStopOrigin(const base::ListValue* args);
84 90
85 // Callback method to be invoked when fetching the data is complete. 91 // Callback method to be invoked when fetching the data is complete.
86 void OnLocalStorageFetched(const LocalStorageList& storage); 92 void OnLocalStorageFetched(const LocalStorageList& storage);
87 93
88 // Get all origins with Content Settings for the last given content setting, 94 // Get all origins with Content Settings for the last given content setting,
89 // filter them by |last_filter_|, and update the page. 95 // filter them by |last_filter_|, and update the page.
90 void UpdateOrigins(); 96 void UpdateOrigins();
(...skipping 13 matching lines...) Expand all
104 void DeleteLocalStorage(const GURL& site_url); 110 void DeleteLocalStorage(const GURL& site_url);
105 111
106 // Populates the single site edit view with the permissions and local storage 112 // Populates the single site edit view with the permissions and local storage
107 // usage for a given |site_url|. If |show_page| is true, it raises a new 113 // usage for a given |site_url|. If |show_page| is true, it raises a new
108 // single site edit view. 114 // single site edit view.
109 void GetInfoForOrigin(const GURL& site_url, bool show_page); 115 void GetInfoForOrigin(const GURL& site_url, bool show_page);
110 116
111 // Updates the page with the last settings used. 117 // Updates the page with the last settings used.
112 void Update(); 118 void Update();
113 119
120 // Gets the default setting in string form. If |provider_id| is not NULL, the
121 // id of the provider which provided the default setting is assigned to it.
122 std::string GetSettingDefaultFromModel(ContentSettingsType type,
123 std::string* provider_id);
124
114 // Returns the base URL for websites, or the app name for Chrome App URLs. 125 // Returns the base URL for websites, or the app name for Chrome App URLs.
115 const std::string& GetReadableName(const GURL& site_url); 126 const std::string& GetReadableName(const GURL& site_url);
116 127
117 std::string last_setting_; 128 std::string last_setting_;
118 std::string last_filter_; 129 std::string last_filter_;
119 GURL last_site_; 130 GURL last_site_;
120 scoped_refptr<BrowsingDataLocalStorageHelper> local_storage_; 131 scoped_refptr<BrowsingDataLocalStorageHelper> local_storage_;
121 LocalStorageList local_storage_list_; 132 LocalStorageList local_storage_list_;
122 133
123 // Observer to watch for content settings changes. 134 // Observer to watch for content settings changes.
124 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; 135 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_;
125 136
126 // Subscription to watch for power consumption updates. 137 // Subscription to watch for power consumption updates.
127 scoped_ptr<power::OriginPowerMap::Subscription> subscription_; 138 scoped_ptr<power::OriginPowerMap::Subscription> subscription_;
128 139
129 base::WeakPtrFactory<WebsiteSettingsHandler> weak_ptr_factory_; 140 base::WeakPtrFactory<WebsiteSettingsHandler> weak_ptr_factory_;
130 141
131 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsHandler); 142 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsHandler);
132 }; 143 };
133 144
134 } // namespace options 145 } // namespace options
135 146
136 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_WEBSITE_SETTINGS_HANDLER_H_ 147 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_WEBSITE_SETTINGS_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698