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

Unified Diff: chrome/browser/chromeos/arc/arc_auth_ui.h

Issue 1618193003: arc: Pass auth token from Chrome to ARC instance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactored. Added LSO UI Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/arc/arc_auth_ui.h
diff --git a/chrome/browser/chromeos/arc/arc_auth_ui.h b/chrome/browser/chromeos/arc/arc_auth_ui.h
new file mode 100644
index 0000000000000000000000000000000000000000..a521c5c3b4d7d43058f559a19e9dc402edd9f68e
--- /dev/null
+++ b/chrome/browser/chromeos/arc/arc_auth_ui.h
@@ -0,0 +1,70 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_UI_H_
+#define CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_UI_H_
+
+#include "base/macros.h"
+#include "chrome/browser/chromeos/arc/arc_auth_fetcher.h"
+#include "ui/web_dialogs/web_dialog_delegate.h"
+
+class Profile;
+
+namespace views {
+class Widget;
+} // namespace views
+
+namespace arc {
+
+// Shows ARC LSO web view that requires user input.
+class ArcAuthUI : public ui::WebDialogDelegate,
+ public ArcAuthFetcher::Delegate {
+ public:
+ class Delegate {
+ public:
+ // Called when dialog is closed.
+ virtual void OnAuthUIClosed() = 0;
+ };
+
+ ArcAuthUI(Profile* profile, Delegate* delegate);
+ ~ArcAuthUI() override;
+
+ void Close();
+
+ // overrides ui::WebDialogDelegate.
+ ui::ModalType GetDialogModalType() const override;
+ base::string16 GetDialogTitle() const override;
+ GURL GetDialogContentURL() const override;
+ void GetWebUIMessageHandlers(
+ std::vector<content::WebUIMessageHandler*>* handlers) const override;
+ void GetDialogSize(gfx::Size* size) const override;
+ std::string GetDialogArgs() const override;
+ void OnDialogClosed(const std::string& json_retval) override;
+ void OnCloseContents(content::WebContents* source,
+ bool* out_close_dialog) override;
+ bool ShouldShowDialogTitle() const override;
+ bool HandleContextMenu(const content::ContextMenuParams& params) override;
+ void OnLoadingStateChanged(content::WebContents* source) override;
+
+ // Overrides ArcAuthFetcher::Delegate.
+ void OnAuthCodeFetched(const std::string& code) override;
+ void OnAuthCodeNeedUI() override;
+ void OnAuthCodeFailed() override;
+
+ private:
+ // Unowned pointers.
+ Profile* profile_;
+ Delegate* delegate_;
+
+ // Owned by view hierarchy.
+ views::Widget* widget_;
+
+ scoped_ptr<ArcAuthFetcher> auth_fetcher_;
+
+ DISALLOW_COPY_AND_ASSIGN(ArcAuthUI);
+};
+
+} // namespace arc
+
+#endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_UI_H_

Powered by Google App Engine
This is Rietveld 408576698