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

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: nit 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(). |is_success| indicates whether the promise will be
33 // resolved or rejected.
33 void CallJavascriptCallback(const base::Value& callback_id, 34 void CallJavascriptCallback(const base::Value& callback_id,
35 bool is_success,
34 const base::Value& response); 36 const base::Value& response);
35 37
36 private: 38 private:
37 DISALLOW_COPY_AND_ASSIGN(SettingsPageUIHandler); 39 DISALLOW_COPY_AND_ASSIGN(SettingsPageUIHandler);
38 }; 40 };
39 41
40 // The WebUI handler for chrome://md-settings. 42 // The WebUI handler for chrome://md-settings.
41 class MdSettingsUI : public content::WebUIController, 43 class MdSettingsUI : public content::WebUIController,
42 public content::WebContentsObserver { 44 public content::WebContentsObserver {
43 public: 45 public:
(...skipping 14 matching lines...) Expand all
58 void AddSettingsPageUIHandler(content::WebUIMessageHandler* handler); 60 void AddSettingsPageUIHandler(content::WebUIMessageHandler* handler);
59 61
60 base::Time load_start_time_; 62 base::Time load_start_time_;
61 63
62 DISALLOW_COPY_AND_ASSIGN(MdSettingsUI); 64 DISALLOW_COPY_AND_ASSIGN(MdSettingsUI);
63 }; 65 };
64 66
65 } // namespace settings 67 } // namespace settings
66 68
67 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_MD_SETTINGS_UI_H_ 69 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_MD_SETTINGS_UI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698