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

Side by Side Diff: chrome/browser/ui/webui/settings/site_settings_handler.h

Issue 1988463002: MD Settings: Convert C++ handlers to be JavaScript-lifecycle aware. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_SETTINGS_SITE_SETTINGS_HANDLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_SITE_SETTINGS_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_SITE_SETTINGS_HANDLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_SITE_SETTINGS_HANDLER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/scoped_observer.h" 10 #include "base/scoped_observer.h"
(...skipping 12 matching lines...) Expand all
23 23
24 // Chrome "ContentSettings" settings page UI handler. 24 // Chrome "ContentSettings" settings page UI handler.
25 class SiteSettingsHandler : public SettingsPageUIHandler, 25 class SiteSettingsHandler : public SettingsPageUIHandler,
26 public content_settings::Observer { 26 public content_settings::Observer {
27 public: 27 public:
28 explicit SiteSettingsHandler(Profile* profile); 28 explicit SiteSettingsHandler(Profile* profile);
29 ~SiteSettingsHandler() override; 29 ~SiteSettingsHandler() override;
30 30
31 // SettingsPageUIHandler: 31 // SettingsPageUIHandler:
32 void RegisterMessages() override; 32 void RegisterMessages() override;
33 void OnJavascriptAllowed() override;
34 void OnJavascriptDisallowed() override;
33 35
34 void OnGetUsageInfo(const storage::UsageInfoEntries& entries); 36 void OnGetUsageInfo(const storage::UsageInfoEntries& entries);
35 void OnUsageInfoCleared(storage::QuotaStatusCode code); 37 void OnUsageInfoCleared(storage::QuotaStatusCode code);
36 38
37 // content_settings::Observer: 39 // content_settings::Observer:
38 void OnContentSettingChanged(const ContentSettingsPattern& primary_pattern, 40 void OnContentSettingChanged(const ContentSettingsPattern& primary_pattern,
39 const ContentSettingsPattern& secondary_pattern, 41 const ContentSettingsPattern& secondary_pattern,
40 ContentSettingsType content_type, 42 ContentSettingsType content_type,
41 std::string resource_identifier) override; 43 std::string resource_identifier) override;
42 private: 44 private:
45 friend class SiteSettingsHandlerTest;
43 FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, GetAndSetDefault); 46 FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, GetAndSetDefault);
44 FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, Origins); 47 FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, Origins);
45 FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, Patterns); 48 FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, Patterns);
46 49
47 // Asynchronously fetches the usage for a given origin. Replies back with 50 // Asynchronously fetches the usage for a given origin. Replies back with
48 // OnGetUsageInfo above. 51 // OnGetUsageInfo above.
49 void HandleFetchUsageTotal(const base::ListValue* args); 52 void HandleFetchUsageTotal(const base::ListValue* args);
50 53
51 // Deletes the storage being used for a given host. 54 // Deletes the storage being used for a given host.
52 void HandleClearUsage(const base::ListValue* args); 55 void HandleClearUsage(const base::ListValue* args);
(...skipping 22 matching lines...) Expand all
75 78
76 // Change observer for content settings. 79 // Change observer for content settings.
77 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; 80 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_;
78 81
79 DISALLOW_COPY_AND_ASSIGN(SiteSettingsHandler); 82 DISALLOW_COPY_AND_ASSIGN(SiteSettingsHandler);
80 }; 83 };
81 84
82 } // namespace settings 85 } // namespace settings
83 86
84 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SITE_SETTINGS_HANDLER_H_ 87 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SITE_SETTINGS_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698