autofill_dialog_sign_in_delegate.h revision 90dce4d38c5ff5333bea97d859d4e484e27edf0c
1// Copyright (c) 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_AUTOFILL_AUTOFILL_DIALOG_SIGN_IN_DELEGATE_H_
6#define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_SIGN_IN_DELEGATE_H_
7
8#include "content/public/browser/web_contents_delegate.h"
9#include "content/public/browser/web_contents_observer.h"
10
11namespace autofill {
12
13class AutofillDialogView;
14
15// AutofillDialogSignInDelegate provides a WebContentsDelegate and
16// WebContentsObserver for the sign-in page in the autofill dialog. Allows the
17// dialog to resize based on the size of the hosted web page.
18// TODO(abodenha) It probably makes sense to move the NotificationObserver
19// for detecting completed sign-in to this class instead of
20// AutofillDialogControllerImpl.
21class AutofillDialogSignInDelegate: public content::WebContentsDelegate,
22                                    public content::WebContentsObserver {
23 public:
24  AutofillDialogSignInDelegate(AutofillDialogView* dialog_view,
25                               content::WebContents* web_contents);
26
27  // WebContentsDelegate implementation.
28  virtual void ResizeDueToAutoResize(content::WebContents* source,
29                                     const gfx::Size& pref_size) OVERRIDE;
30
31  // WebContentsObserver implementation.
32  virtual void RenderViewCreated(
33      content::RenderViewHost* render_view_host) OVERRIDE;
34
35 private:
36  AutofillDialogView* dialog_view_;
37};
38
39}  // namespace autofill
40
41#endif  // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_SIGN_IN_DELEGATE_H_
42