1 // Copyright 2014 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_LOGIN_UI_CAPTIVE_PORTAL_VIEW_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_CAPTIVE_PORTAL_VIEW_H_ 7 8 #include <string> 9 #include "base/macros.h" 10 #include "chrome/browser/chromeos/login/ui/simple_web_view_dialog.h" 11 12 namespace chromeos { 13 14 class CaptivePortalWindowProxy; 15 16 class CaptivePortalView : public SimpleWebViewDialog { 17 public: 18 CaptivePortalView(Profile* profile, CaptivePortalWindowProxy* proxy); 19 ~CaptivePortalView() override; 20 21 // Starts loading. 22 void StartLoad(); 23 24 // Overridden from content::WebContentsDelegate: 25 void NavigationStateChanged(content::WebContents* source, 26 content::InvalidateTypes changed_flags) override; 27 void LoadingStateChanged(content::WebContents* source, 28 bool to_different_document) override; 29 30 // Overridden from SimpleWebViewDialog: 31 std::unique_ptr<views::WidgetDelegate> MakeWidgetDelegate() override; 32 33 private: 34 // Contains CaptivePortalWindowProxy to be notified when redirection state is 35 // resolved. 36 CaptivePortalWindowProxy* proxy_; 37 38 bool redirected_; 39 40 DISALLOW_COPY_AND_ASSIGN(CaptivePortalView); 41 }; 42 43 } // namespace chromeos 44 45 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_CAPTIVE_PORTAL_VIEW_H_ 46