Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / chromeos / net / network_portal_web_dialog.h
blobd483353196fd716b719018034fb22c973474f5e0
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.
5 #ifndef CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_WEB_DIALOG_H_
6 #define CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_WEB_DIALOG_H_
8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h"
10 #include "chrome/browser/chromeos/net/network_portal_notification_controller.h"
11 #include "ui/web_dialogs/web_dialog_delegate.h"
13 namespace views {
14 class Widget;
17 namespace chromeos {
19 // This is the modal Web dialog to display captive portal login page.
20 // It is automatically closed when successful authorization is detected.
21 class NetworkPortalWebDialog : public ui::WebDialogDelegate {
22 public:
23 explicit NetworkPortalWebDialog(
24 base::WeakPtr<NetworkPortalNotificationController> controller);
25 ~NetworkPortalWebDialog() override;
27 void SetWidget(views::Widget* widget);
28 void Close();
30 private:
31 // ui::WebDialogDelegate:
32 ui::ModalType GetDialogModalType() const override;
33 base::string16 GetDialogTitle() const override;
34 GURL GetDialogContentURL() const override;
35 void GetWebUIMessageHandlers(
36 std::vector<content::WebUIMessageHandler*>* handlers) const override;
37 void GetDialogSize(gfx::Size* size) const override;
38 std::string GetDialogArgs() const override;
39 bool CanResizeDialog() const override;
40 void OnDialogClosed(const std::string& json_retval) override;
41 void OnCloseContents(content::WebContents* source,
42 bool* out_close_dialog) override;
43 bool ShouldShowDialogTitle() const override;
45 base::WeakPtr<NetworkPortalNotificationController> controller_;
47 views::Widget* widget_;
49 DISALLOW_COPY_AND_ASSIGN(NetworkPortalWebDialog);
52 } // namespace chromeos
54 #endif // CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_WEB_DIALOG_H_