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

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

Issue 1758013002: WebUI: Allow rejecting a promise that is returned from cr.sendWithPromise(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-rename Created 4 years, 9 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 (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_MD_SETTINGS_UI_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_MD_SETTINGS_UI_H_
6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_MD_SETTINGS_UI_H_ 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_MD_SETTINGS_UI_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 11 matching lines...) Expand all
22 class SettingsPageUIHandler : public content::WebUIMessageHandler { 22 class SettingsPageUIHandler : public content::WebUIMessageHandler {
23 public: 23 public:
24 SettingsPageUIHandler(); 24 SettingsPageUIHandler();
25 ~SettingsPageUIHandler() override; 25 ~SettingsPageUIHandler() override;
26 26
27 // WebUIMessageHandler implementation. 27 // WebUIMessageHandler implementation.
28 void RegisterMessages() override {} 28 void RegisterMessages() override {}
29 29
30 protected: 30 protected:
31 // Helper method for responding to JS requests initiated with 31 // Helper method for responding to JS requests initiated with
32 // cr.sendWithPromise(). 32 // cr.sendWithPromise(), for the case where the returned promise should be
33 void CallJavascriptCallback(const base::Value& callback_id, 33 // resolved (request succeeded).
34 const base::Value& response); 34 void ResolveJavascriptCallback(const base::Value& callback_id,
35 const base::Value& response);
36
37 // Helper method for responding to JS requests initiated with
38 // cr.sendWithPromise(), for the case where the returned promise should be
39 // rejected (request failed).
40 void RejectJavascriptCallback(const base::Value& callback_id,
41 const base::Value& response);
35 42
36 private: 43 private:
37 DISALLOW_COPY_AND_ASSIGN(SettingsPageUIHandler); 44 DISALLOW_COPY_AND_ASSIGN(SettingsPageUIHandler);
38 }; 45 };
39 46
40 // The WebUI handler for chrome://md-settings. 47 // The WebUI handler for chrome://md-settings.
41 class MdSettingsUI : public content::WebUIController, 48 class MdSettingsUI : public content::WebUIController,
42 public content::WebContentsObserver { 49 public content::WebContentsObserver {
43 public: 50 public:
44 explicit MdSettingsUI(content::WebUI* web_ui); 51 explicit MdSettingsUI(content::WebUI* web_ui);
(...skipping 13 matching lines...) Expand all
58 void AddSettingsPageUIHandler(content::WebUIMessageHandler* handler); 65 void AddSettingsPageUIHandler(content::WebUIMessageHandler* handler);
59 66
60 base::Time load_start_time_; 67 base::Time load_start_time_;
61 68
62 DISALLOW_COPY_AND_ASSIGN(MdSettingsUI); 69 DISALLOW_COPY_AND_ASSIGN(MdSettingsUI);
63 }; 70 };
64 71
65 } // namespace settings 72 } // namespace settings
66 73
67 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_MD_SETTINGS_UI_H_ 74 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_MD_SETTINGS_UI_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/settings/appearance_handler.cc ('k') | chrome/browser/ui/webui/settings/md_settings_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698