1 // Copyright 2020 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_CHROMEOS_WEB_APPLICATIONS_CHROME_HELP_APP_UI_DELEGATE_H_
6 #define CHROME_BROWSER_CHROMEOS_WEB_APPLICATIONS_CHROME_HELP_APP_UI_DELEGATE_H_
7 
8 #include "base/optional.h"
9 #include "chromeos/components/help_app_ui/help_app_ui_delegate.h"
10 
11 namespace content {
12 class WebUI;
13 }
14 
15 /**
16  * Implementation of the HelpAppUiDelegate interface. Provides the help app
17  * code in chromeos/ with functions that only exist in chrome/.
18  */
19 class ChromeHelpAppUIDelegate : public HelpAppUIDelegate {
20  public:
21   explicit ChromeHelpAppUIDelegate(content::WebUI* web_ui);
22 
23   ChromeHelpAppUIDelegate(const ChromeHelpAppUIDelegate&) = delete;
24   ChromeHelpAppUIDelegate& operator=(const ChromeHelpAppUIDelegate&) = delete;
25 
26   // HelpAppUIDelegate:
27   base::Optional<std::string> OpenFeedbackDialog() override;
28   void PopulateLoadTimeData(content::WebUIDataSource* source) override;
29   void ShowParentalControls() override;
30   PrefService* GetLocalState() override;
31 
32  private:
33   content::WebUI* web_ui_;  // Owns |this|.
34 };
35 
36 #endif  // CHROME_BROWSER_CHROMEOS_WEB_APPLICATIONS_CHROME_HELP_APP_UI_DELEGATE_H_
37