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 IOS_COMPONENTS_SECURITY_INTERSTITIALS_LOOKALIKES_LOOKALIKE_URL_CONTROLLER_CLIENT_H_
6 #define IOS_COMPONENTS_SECURITY_INTERSTITIALS_LOOKALIKES_LOOKALIKE_URL_CONTROLLER_CLIENT_H_
7 
8 #include "ios/components/security_interstitials/ios_blocking_page_controller_client.h"
9 #include "url/gurl.h"
10 
11 class GURL;
12 
13 namespace web {
14 class WebState;
15 }  // namespace web
16 
17 // Controller client used for lookalike URL blocking pages.
18 class LookalikeUrlControllerClient
19     : public security_interstitials::IOSBlockingPageControllerClient {
20  public:
21   LookalikeUrlControllerClient(web::WebState* web_state,
22                                const GURL& safe_url,
23                                const GURL& request_url,
24                                const std::string& app_locale);
25   ~LookalikeUrlControllerClient() override;
26 
27   // security_interstitials::ControllerClient:
28   void Proceed() override;
29   void GoBack() override;
30 
31  private:
32   // The URL suggested to the user as the safe URL. Can be empty, in which case
33   // the default action on the interstitial closes the tab.
34   const GURL safe_url_;
35   // The URL of the page causing the insterstitial.
36   const GURL request_url_;
37 };
38 
39 #endif  // IOS_COMPONENTS_SECURITY_INTERSTITIALS_LOOKALIKES_LOOKALIKE_URL_CONTROLLER_CLIENT_H_
40