1// Copyright 2013 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_UI_SYNC_INLINE_LOGIN_DIALOG_H_
6#define CHROME_BROWSER_UI_SYNC_INLINE_LOGIN_DIALOG_H_
7
8#include <string>
9#include <vector>
10
11#include "base/basictypes.h"
12#include "base/compiler_specific.h"
13#include "ui/web_dialogs/web_dialog_delegate.h"
14
15class Profile;
16
17// A dialog to host the inline sign-in WebUI. Currently, it loads
18// chrome:://chrome-signin and dismisses itself when the sign-in is finished
19// successfully.
20class InlineLoginDialog : public ui::WebDialogDelegate {
21 public:
22  static void Show(Profile* profile);
23
24 private:
25  explicit InlineLoginDialog(Profile* profile);
26
27  // ui::WebDialogDelegate overrides:
28  virtual ui::ModalType GetDialogModalType() const OVERRIDE;
29  virtual base::string16 GetDialogTitle() const OVERRIDE;
30  virtual GURL GetDialogContentURL() const OVERRIDE;
31  virtual void GetWebUIMessageHandlers(
32      std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE;
33  virtual void GetDialogSize(gfx::Size* size) const OVERRIDE;
34  virtual std::string GetDialogArgs() const OVERRIDE;
35  virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE;
36  virtual void OnCloseContents(
37      content::WebContents* source, bool* out_close_dialog) OVERRIDE;
38  virtual bool ShouldShowDialogTitle() const OVERRIDE;
39  virtual bool HandleContextMenu(
40      const content::ContextMenuParams& params) OVERRIDE;
41
42  Profile* profile_;
43
44  DISALLOW_COPY_AND_ASSIGN(InlineLoginDialog);
45};
46
47#endif  // CHROME_BROWSER_UI_SYNC_INLINE_LOGIN_DIALOG_H_
48