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

Side by Side Diff: chrome/browser/ui/webui/settings/settings_manage_profile_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_SETTINGS_MANAGE_PROFILE_HANDLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_MANAGE_PROFILE_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_MANAGE_PROFILE_HANDLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_MANAGE_PROFILE_HANDLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 12 matching lines...) Expand all
23 23
24 // Chrome personal stuff profiles manage overlay UI handler. 24 // Chrome personal stuff profiles manage overlay UI handler.
25 class ManageProfileHandler : public settings::SettingsPageUIHandler, 25 class ManageProfileHandler : public settings::SettingsPageUIHandler,
26 public ProfileAttributesStorage::Observer { 26 public ProfileAttributesStorage::Observer {
27 public: 27 public:
28 explicit ManageProfileHandler(Profile* profile); 28 explicit ManageProfileHandler(Profile* profile);
29 ~ManageProfileHandler() override; 29 ~ManageProfileHandler() override;
30 30
31 // settings::SettingsPageUIHandler: 31 // settings::SettingsPageUIHandler:
32 void RegisterMessages() override; 32 void RegisterMessages() override;
33 void OnJavascriptAllowed() override;
34 void OnJavascriptDisallowed() override;
33 35
34 // ProfileAttributesStorage::Observer: 36 // ProfileAttributesStorage::Observer:
35 void OnProfileAvatarChanged(const base::FilePath& profile_path) override; 37 void OnProfileAvatarChanged(const base::FilePath& profile_path) override;
36 38
37 private: 39 private:
40 friend class ManageProfileHandlerTest;
Dan Beam 2016/05/19 03:36:54 you don't need this if you just raise access to pu
tommycli 2016/05/19 19:27:15 Done.
38 FRIEND_TEST_ALL_PREFIXES(ManageProfileHandlerTest, 41 FRIEND_TEST_ALL_PREFIXES(ManageProfileHandlerTest,
39 HandleSetProfileIconAndName); 42 HandleSetProfileIconAndName);
40 FRIEND_TEST_ALL_PREFIXES(ManageProfileHandlerTest, HandleGetAvailableIcons); 43 FRIEND_TEST_ALL_PREFIXES(ManageProfileHandlerTest, HandleGetAvailableIcons);
41 44
42 // Callback for the "getAvailableIcons" message. 45 // Callback for the "getAvailableIcons" message.
43 // Sends the array of default profile icon URLs and profile names to WebUI. 46 // Sends the array of default profile icon URLs and profile names to WebUI.
44 void HandleGetAvailableIcons(const base::ListValue* args); 47 void HandleGetAvailableIcons(const base::ListValue* args);
45 48
46 // Get all the available profile icons to choose from. 49 // Get all the available profile icons to choose from.
47 std::unique_ptr<base::ListValue> GetAvailableIcons(); 50 std::unique_ptr<base::ListValue> GetAvailableIcons();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 88
86 // For generating weak pointers to itself for callbacks. 89 // For generating weak pointers to itself for callbacks.
87 base::WeakPtrFactory<ManageProfileHandler> weak_factory_; 90 base::WeakPtrFactory<ManageProfileHandler> weak_factory_;
88 91
89 DISALLOW_COPY_AND_ASSIGN(ManageProfileHandler); 92 DISALLOW_COPY_AND_ASSIGN(ManageProfileHandler);
90 }; 93 };
91 94
92 } // namespace settings 95 } // namespace settings
93 96
94 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_MANAGE_PROFILE_HANDLER_H_ 97 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_MANAGE_PROFILE_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698