Commit d8497113 authored by estade@chromium.org's avatar estade@chromium.org

rAc: split TestableAutofillDialogView implementation into its own class

This:
- makes use of a funky downcast
- moves TestableAutofillDialogViews code out of the production binary
- makes it impossible to accidentally call testing code from production code

mac implementation by groby@chromium.org

BUG=306200

Review URL: https://codereview.chromium.org/135933003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247886 0039d316-1c4b-4281-b951-d872f2087c98
parent e03e8f96
......@@ -646,10 +646,6 @@ void AutofillDialogControllerImpl::TabActivated() {
}
}
TestableAutofillDialogView* AutofillDialogControllerImpl::GetTestableView() {
return view_ ? view_->GetTestableView() : NULL;
}
////////////////////////////////////////////////////////////////////////////////
// AutofillDialogViewDelegate implementation.
......
......@@ -54,7 +54,6 @@ class AutofillDataModel;
class AutofillDialogView;
class AutofillPopupControllerImpl;
class DataModelWrapper;
class TestableAutofillDialogView;
namespace risk {
class Fingerprint;
......@@ -91,10 +90,6 @@ class AutofillDialogControllerImpl : public AutofillDialogViewDelegate,
virtual void Hide() OVERRIDE;
virtual void TabActivated() OVERRIDE;
// Returns |view_| as a testable version of itself (if |view_| exists and
// actually implements |AutofillDialogView::GetTestableView()|).
TestableAutofillDialogView* GetTestableView();
// AutofillDialogViewDelegate implementation.
virtual base::string16 DialogTitle() const OVERRIDE;
virtual base::string16 AccountChooserText() const OVERRIDE;
......
......@@ -186,9 +186,6 @@ class TestAutofillDialogView : public AutofillDialogView {
OVERRIDE {
*output = outputs_[section];
}
virtual TestableAutofillDialogView* GetTestableView() OVERRIDE {
return NULL;
}
virtual base::string16 GetCvc() OVERRIDE { return base::string16(); }
virtual bool HitTestInput(ServerFieldType type,
......
......@@ -6,8 +6,6 @@
#include "chrome/browser/ui/autofill/autofill_dialog_view.h"
#include "chrome/browser/ui/autofill/testable_autofill_dialog_view.h"
namespace autofill {
AutofillDialogView::~AutofillDialogView() {}
......
......@@ -19,7 +19,6 @@ class Size;
namespace autofill {
class AutofillDialogViewDelegate;
class TestableAutofillDialogView;
// An interface for the dialog that appears when a site initiates an Autofill
// action via the imperative autocomplete API.
......@@ -98,10 +97,6 @@ class AutofillDialogView {
// Called when the active suggestions data model changed.
virtual void ModelChanged() = 0;
// Returns an object that can be used to test that the view is behaving as
// expected.
virtual TestableAutofillDialogView* GetTestableView() = 0;
// Called by AutofillDialogSignInDelegate when the sign-in page experiences a
// resize. |pref_size| is the new preferred size of the sign-in page.
virtual void OnSignInResize(const gfx::Size& pref_size) = 0;
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Copyright 2014 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_UI_AUTOFILL_TESTABLE_AUTOFILL_DIALOG_VIEW_H_
#define CHROME_BROWSER_UI_AUTOFILL_TESTABLE_AUTOFILL_DIALOG_VIEW_H_
#ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_TESTER_H_
#define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_TESTER_H_
#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
#include "chrome/browser/ui/autofill/autofill_dialog_types.h"
#include "components/autofill/core/browser/field_types.h"
#include "ui/gfx/size.h"
namespace content {
class WebContents;
}
namespace autofill {
// Functions that an AutofillDialogView implementation should implement in order
// to assist in unit testing.
class TestableAutofillDialogView {
class AutofillDialogView;
// Functionality that helps to test an AutofillDialogView.
class AutofillDialogViewTester {
public:
virtual ~TestableAutofillDialogView() {}
// Gets a AutofillDialogViewTester for |view|.
static scoped_ptr<AutofillDialogViewTester> For(AutofillDialogView* view);
virtual ~AutofillDialogViewTester() {}
// Simulates the user pressing 'Submit' to accept the dialog.
virtual void SubmitForTesting() = 0;
......@@ -45,4 +59,4 @@ class TestableAutofillDialogView {
} // namespace autofill
#endif // CHROME_BROWSER_UI_AUTOFILL_TESTABLE_AUTOFILL_DIALOG_VIEW_H_
#endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_TESTER_H_
......@@ -10,7 +10,6 @@
#include "base/memory/weak_ptr.h"
#include "chrome/browser/ui/autofill/autofill_dialog_types.h"
#include "chrome/browser/ui/autofill/autofill_dialog_view.h"
#include "chrome/browser/ui/autofill/testable_autofill_dialog_view.h"
#include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h"
#include "ui/gfx/size.h"
......@@ -20,6 +19,7 @@ class NavigationController;
namespace autofill {
class AutofillDialogViewDelegate;
class AutofillDialogViewTesterCocoa;
}
@class AutofillDialogWindowController;
......@@ -27,7 +27,6 @@ class AutofillDialogViewDelegate;
namespace autofill {
class AutofillDialogCocoa : public AutofillDialogView,
public TestableAutofillDialogView,
public ConstrainedWindowMacDelegate {
public:
explicit AutofillDialogCocoa(AutofillDialogViewDelegate* delegate);
......@@ -57,25 +56,8 @@ class AutofillDialogCocoa : public AutofillDialogView,
virtual const content::NavigationController* ShowSignIn() OVERRIDE;
virtual void HideSignIn() OVERRIDE;
virtual void ModelChanged() OVERRIDE;
virtual TestableAutofillDialogView* GetTestableView() OVERRIDE;
virtual void OnSignInResize(const gfx::Size& pref_size) OVERRIDE;
// TestableAutofillDialogView implementation:
// TODO(groby): Create a separate class to implement the testable interface:
// http://crbug.com/256864
virtual void SubmitForTesting() OVERRIDE;
virtual void CancelForTesting() OVERRIDE;
virtual base::string16 GetTextContentsOfInput(ServerFieldType type) OVERRIDE;
virtual void SetTextContentsOfInput(ServerFieldType type,
const base::string16& contents) OVERRIDE;
virtual void SetTextContentsOfSuggestionInput(
DialogSection section,
const base::string16& text) OVERRIDE;
virtual void ActivateInput(ServerFieldType type) OVERRIDE;
virtual gfx::Size GetSize() const OVERRIDE;
virtual content::WebContents* GetSignInWebContents() OVERRIDE;
virtual bool IsShowingOverlay() const OVERRIDE;
// ConstrainedWindowMacDelegate implementation:
virtual void OnConstrainedWindowClosed(
ConstrainedWindowMac* window) OVERRIDE;
......@@ -86,6 +68,8 @@ class AutofillDialogCocoa : public AutofillDialogView,
void PerformClose();
private:
friend class AutofillDialogViewTesterCocoa;
// Closes the sheet and ends the modal loop. Triggers cleanup sequence.
void CloseNow();
......
......@@ -134,68 +134,11 @@ void AutofillDialogCocoa::UpdateErrorBubble() {
[sheet_delegate_ updateErrorBubble];
}
TestableAutofillDialogView* AutofillDialogCocoa::GetTestableView() {
return this;
}
void AutofillDialogCocoa::OnSignInResize(const gfx::Size& pref_size) {
[sheet_delegate_ onSignInResize:
NSMakeSize(pref_size.width(), pref_size.height())];
}
void AutofillDialogCocoa::SubmitForTesting() {
[sheet_delegate_ accept:nil];
}
void AutofillDialogCocoa::CancelForTesting() {
[sheet_delegate_ cancel:nil];
}
base::string16 AutofillDialogCocoa::GetTextContentsOfInput(
ServerFieldType type) {
for (size_t i = SECTION_MIN; i <= SECTION_MAX; ++i) {
DialogSection section = static_cast<DialogSection>(i);
FieldValueMap contents;
[sheet_delegate_ getInputs:&contents forSection:section];
FieldValueMap::const_iterator it = contents.find(type);
if (it != contents.end())
return it->second;
}
NOTREACHED();
return base::string16();
}
void AutofillDialogCocoa::SetTextContentsOfInput(
ServerFieldType type,
const base::string16& contents) {
[sheet_delegate_ setTextContents:base::SysUTF16ToNSString(contents)
forType:type];
}
void AutofillDialogCocoa::SetTextContentsOfSuggestionInput(
DialogSection section,
const base::string16& text) {
[sheet_delegate_ setTextContents:base::SysUTF16ToNSString(text)
ofSuggestionForSection:section];
}
void AutofillDialogCocoa::ActivateInput(ServerFieldType type) {
[sheet_delegate_ activateFieldForType:type];
}
gfx::Size AutofillDialogCocoa::GetSize() const {
return gfx::Size(NSSizeToCGSize([[sheet_delegate_ window] frame].size));
}
content::WebContents* AutofillDialogCocoa::GetSignInWebContents() {
return [sheet_delegate_ getSignInWebContents];
}
bool AutofillDialogCocoa::IsShowingOverlay() const {
return [sheet_delegate_ isShowingOverlay];
}
void AutofillDialogCocoa::OnConstrainedWindowClosed(
ConstrainedWindowMac* window) {
......
// Copyright 2014 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_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_VIEW_TESTER_COCOA_H_
#define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_VIEW_TESTER_COCOA_H_
#include "base/basictypes.h"
#include "chrome/browser/ui/autofill/autofill_dialog_view_tester.h"
@class AutofillDialogWindowController;
namespace autofill {
class AutofillDialogCocoa;
class AutofillDialogViewTesterCocoa: public AutofillDialogViewTester {
public:
explicit AutofillDialogViewTesterCocoa(AutofillDialogCocoa* dialog);
virtual ~AutofillDialogViewTesterCocoa();
// TestableAutofillDialogView implementation:
virtual void SubmitForTesting() OVERRIDE;
virtual void CancelForTesting() OVERRIDE;
virtual base::string16 GetTextContentsOfInput(ServerFieldType type) OVERRIDE;
virtual void SetTextContentsOfInput(ServerFieldType type,
const base::string16& contents) OVERRIDE;
virtual void SetTextContentsOfSuggestionInput(
DialogSection section,
const base::string16& text) OVERRIDE;
virtual void ActivateInput(ServerFieldType type) OVERRIDE;
virtual gfx::Size GetSize() const OVERRIDE;
virtual content::WebContents* GetSignInWebContents() OVERRIDE;
virtual bool IsShowingOverlay() const OVERRIDE;
private:
AutofillDialogWindowController* controller() const;
AutofillDialogCocoa* dialog_;
DISALLOW_COPY_AND_ASSIGN(AutofillDialogViewTesterCocoa);
};
} // autofill
#endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_DIALOG_VIEW_TESTER_COCOA_H_
// Copyright 2014 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.
#include "chrome/browser/ui/cocoa/autofill/autofill_dialog_view_tester_cocoa.h"
#include "base/strings/sys_string_conversions.h"
#include "chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.h"
#import "chrome/browser/ui/cocoa/autofill/autofill_dialog_window_controller.h"
#import "chrome/browser/ui/cocoa/autofill/autofill_main_container.h"
#import "chrome/browser/ui/cocoa/autofill/autofill_section_container.h"
#import "chrome/browser/ui/cocoa/autofill/autofill_sign_in_container.h"
// Mirrors the AutofillDialogViewTester API on the C++ side.
@interface AutofillDialogWindowController (AutofillDialogViewTesterCocoa)
- (void)setTextContents:(NSString*)text
forType:(autofill::ServerFieldType)type;
- (void)setTextContents:(NSString*)text
ofSuggestionForSection:(autofill::DialogSection)section;
- (void)activateFieldForType:(autofill::ServerFieldType)type;
- (content::WebContents*)getSignInWebContents;
- (BOOL)isShowingOverlay;
@end
@implementation AutofillDialogWindowController (AutofillDialogViewTesterCocoa)
- (void)setTextContents:(NSString*)text
forType:(autofill::ServerFieldType)type {
for (size_t i = autofill::SECTION_MIN; i <= autofill::SECTION_MAX; ++i) {
autofill::DialogSection section = static_cast<autofill::DialogSection>(i);
// TODO(groby): Need to find the section for an input directly - wasteful.
[[mainContainer_ sectionForId:section] setFieldValue:text forType:type];
}
}
- (void)setTextContents:(NSString*)text
ofSuggestionForSection:(autofill::DialogSection)section {
[[mainContainer_ sectionForId:section] setSuggestionFieldValue:text];
}
- (void)activateFieldForType:(autofill::ServerFieldType)type {
for (size_t i = autofill::SECTION_MIN; i <= autofill::SECTION_MAX; ++i) {
autofill::DialogSection section = static_cast<autofill::DialogSection>(i);
[[mainContainer_ sectionForId:section] activateFieldForType:type];
}
}
- (content::WebContents*)getSignInWebContents {
return [signInContainer_ webContents];
}
- (BOOL)isShowingOverlay {
return ![[overlayController_ view] isHidden];
}
@end
namespace autofill {
scoped_ptr<AutofillDialogViewTester> AutofillDialogViewTester::For(
AutofillDialogView* dialog) {
return scoped_ptr<AutofillDialogViewTester>(
new AutofillDialogViewTesterCocoa(
static_cast<AutofillDialogCocoa*>(dialog)));
}
AutofillDialogViewTesterCocoa::AutofillDialogViewTesterCocoa(
AutofillDialogCocoa* dialog)
: dialog_(dialog) {}
AutofillDialogViewTesterCocoa::~AutofillDialogViewTesterCocoa() {}
void AutofillDialogViewTesterCocoa::SubmitForTesting() {
[controller() accept:nil];
}
void AutofillDialogViewTesterCocoa::CancelForTesting() {
[controller() cancel:nil];
}
base::string16 AutofillDialogViewTesterCocoa::GetTextContentsOfInput(
ServerFieldType type) {
for (size_t i = SECTION_MIN; i <= SECTION_MAX; ++i) {
DialogSection section = static_cast<DialogSection>(i);
FieldValueMap contents;
[controller() getInputs:&contents forSection:section];
FieldValueMap::const_iterator it = contents.find(type);
if (it != contents.end())
return it->second;
}
NOTREACHED();
return base::string16();
}
void AutofillDialogViewTesterCocoa::SetTextContentsOfInput(
ServerFieldType type,
const base::string16& contents) {
[controller() setTextContents:base::SysUTF16ToNSString(contents)
forType:type];
}
void AutofillDialogViewTesterCocoa::SetTextContentsOfSuggestionInput(
DialogSection section,
const base::string16& text) {
[controller() setTextContents:base::SysUTF16ToNSString(text)
ofSuggestionForSection:section];
}
void AutofillDialogViewTesterCocoa::ActivateInput(ServerFieldType type) {
[controller() activateFieldForType:type];
}
gfx::Size AutofillDialogViewTesterCocoa::GetSize() const {
return gfx::Size(NSSizeToCGSize([[controller() window] frame].size));
}
content::WebContents* AutofillDialogViewTesterCocoa::GetSignInWebContents() {
return [controller() getSignInWebContents];
}
bool AutofillDialogViewTesterCocoa::IsShowingOverlay() const {
return [controller() isShowingOverlay];
}
AutofillDialogWindowController*
AutofillDialogViewTesterCocoa::controller() const {
return dialog_->sheet_delegate_;
}
} // namespace autofill
// Copyright 2014 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.
#include "chrome/browser/ui/views/autofill/autofill_dialog_view_tester_views.h"
#include "base/logging.h"
#include "chrome/browser/ui/views/autofill/autofill_dialog_views.h"
#include "chrome/browser/ui/views/autofill/decorated_textfield.h"
#include "ui/base/models/combobox_model.h"
#include "ui/views/controls/combobox/combobox.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/controls/webview/webview.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/dialog_client_view.h"
namespace autofill {
scoped_ptr<AutofillDialogViewTester> AutofillDialogViewTester::For(
AutofillDialogView* view) {
return scoped_ptr<AutofillDialogViewTester>(new
AutofillDialogViewTesterViews(static_cast<AutofillDialogViews*>(view)));
}
AutofillDialogViewTesterViews::AutofillDialogViewTesterViews(
AutofillDialogViews* view)
: view_(view) {}
AutofillDialogViewTesterViews::~AutofillDialogViewTesterViews() {}
void AutofillDialogViewTesterViews::SubmitForTesting() {
view_->Accept();
}
void AutofillDialogViewTesterViews::CancelForTesting() {
view_->GetDialogClientView()->CancelWindow();
}
base::string16 AutofillDialogViewTesterViews::GetTextContentsOfInput(
ServerFieldType type) {
views::Textfield* textfield = view_->TextfieldForType(type);
if (textfield)
return textfield->text();
views::Combobox* combobox = view_->ComboboxForType(type);
if (combobox)
return combobox->model()->GetItemAt(combobox->selected_index());
NOTREACHED();
return base::string16();
}
void AutofillDialogViewTesterViews::SetTextContentsOfInput(
ServerFieldType type,
const base::string16& contents) {
views::Textfield* textfield = view_->TextfieldForType(type);
if (textfield) {
textfield->SetText(contents);
return;
}
views::Combobox* combobox = view_->ComboboxForType(type);
if (combobox) {
if (!combobox->SelectValue(contents))
combobox->SetSelectedIndex(combobox->model()->GetDefaultIndex());
return;
}
NOTREACHED();
}
void AutofillDialogViewTesterViews::SetTextContentsOfSuggestionInput(
DialogSection section,
const base::string16& text) {
view_->GroupForSection(section)->suggested_info->decorated_textfield()->
SetText(text);
}
void AutofillDialogViewTesterViews::ActivateInput(ServerFieldType type) {
view_->InputEditedOrActivated(type, gfx::Rect(), false);
}
gfx::Size AutofillDialogViewTesterViews::GetSize() const {
return view_->GetWidget() ? view_->GetWidget()->GetRootView()->size() :
gfx::Size();
}
content::WebContents* AutofillDialogViewTesterViews::GetSignInWebContents() {
return view_->sign_in_web_view_->web_contents();
}
bool AutofillDialogViewTesterViews::IsShowingOverlay() const {
return view_->overlay_view_->visible();
}
} // namespace autofill
// Copyright 2014 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_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEW_TESTER_VIEWS_H_
#define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEW_TESTER_VIEWS_H_
#include "base/basictypes.h"
#include "chrome/browser/ui/autofill/autofill_dialog_view_tester.h"
namespace autofill {
class AutofillDialogViews;
class AutofillDialogViewTesterViews : public AutofillDialogViewTester {
public:
explicit AutofillDialogViewTesterViews(AutofillDialogViews* view);
virtual ~AutofillDialogViewTesterViews();
// TestableAutofillDialogView implementation:
virtual void SubmitForTesting() OVERRIDE;
virtual void CancelForTesting() OVERRIDE;
virtual base::string16 GetTextContentsOfInput(ServerFieldType type) OVERRIDE;
virtual void SetTextContentsOfInput(ServerFieldType type,
const base::string16& contents) OVERRIDE;
virtual void SetTextContentsOfSuggestionInput(
DialogSection section,
const base::string16& text) OVERRIDE;
virtual void ActivateInput(ServerFieldType type) OVERRIDE;
virtual gfx::Size GetSize() const OVERRIDE;
virtual content::WebContents* GetSignInWebContents() OVERRIDE;
virtual bool IsShowingOverlay() const OVERRIDE;
private:
AutofillDialogViews* view_;
DISALLOW_COPY_AND_ASSIGN(AutofillDialogViewTesterViews);
};
} // namespace autofill
#endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEW_TESTER_VIEWS_H_
......@@ -1441,78 +1441,11 @@ void AutofillDialogViews::ModelChanged() {
}
}
TestableAutofillDialogView* AutofillDialogViews::GetTestableView() {
return this;
}
void AutofillDialogViews::OnSignInResize(const gfx::Size& pref_size) {
sign_in_web_view_->SetPreferredSize(pref_size);
ContentsPreferredSizeChanged();
}
void AutofillDialogViews::SubmitForTesting() {
Accept();
}
void AutofillDialogViews::CancelForTesting() {
GetDialogClientView()->CancelWindow();
}
base::string16 AutofillDialogViews::GetTextContentsOfInput(
ServerFieldType type) {
views::Textfield* textfield = TextfieldForType(type);
if (textfield)
return textfield->text();
views::Combobox* combobox = ComboboxForType(type);
if (combobox)
return combobox->model()->GetItemAt(combobox->selected_index());
NOTREACHED();
return base::string16();
}
void AutofillDialogViews::SetTextContentsOfInput(
ServerFieldType type,
const base::string16& contents) {
views::Textfield* textfield = TextfieldForType(type);
if (textfield) {
textfield->SetText(contents);
return;
}
views::Combobox* combobox = ComboboxForType(type);
if (combobox) {
SelectComboboxValueOrSetToDefault(combobox, contents);
return;
}
NOTREACHED();
}
void AutofillDialogViews::SetTextContentsOfSuggestionInput(
DialogSection section,
const base::string16& text) {
GroupForSection(section)->suggested_info->decorated_textfield()->
SetText(text);
}
void AutofillDialogViews::ActivateInput(ServerFieldType type) {
InputEditedOrActivated(type, gfx::Rect(), false);
}
gfx::Size AutofillDialogViews::GetSize() const {
return GetWidget() ? GetWidget()->GetRootView()->size() : gfx::Size();
}
content::WebContents* AutofillDialogViews::GetSignInWebContents() {
return sign_in_web_view_->web_contents();
}
bool AutofillDialogViews::IsShowingOverlay() const {
return overlay_view_->visible();
}
gfx::Size AutofillDialogViews::GetPreferredSize() {
if (preferred_size_.IsEmpty())
preferred_size_ = CalculatePreferredSize(false);
......@@ -2284,15 +2217,20 @@ void AutofillDialogViews::InputEditedOrActivated(ServerFieldType type,
DCHECK_NE(UNKNOWN_TYPE, type);
DecoratedTextfield* decorated = TextfieldForType(type);
DetailsGroup* group = decorated ?
GroupForView(decorated) : GroupForView(ComboboxForType(type));
views::Combobox* combobox = ComboboxForType(type);
DCHECK_NE(!!combobox, !!decorated);
DetailsGroup* group = decorated ? GroupForView(decorated) :
GroupForView(combobox);
base::string16 text = decorated ?
decorated->text() :
combobox->model()->GetItemAt(combobox->selected_index());
DCHECK(group);
delegate_->UserEditedOrActivatedInput(group->section,
type,
GetWidget()->GetNativeView(),
bounds,
GetTextContentsOfInput(type),
text,
was_edit);
// If the field is a textfield and is invalid, check if the text is now valid.
......
......@@ -14,7 +14,6 @@
#include "chrome/browser/ui/autofill/autofill_dialog_types.h"
#include "chrome/browser/ui/autofill/autofill_dialog_view.h"
#include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h"
#include "chrome/browser/ui/autofill/testable_autofill_dialog_view.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/button/menu_button.h"
#include "ui/views/controls/button/menu_button_listener.h"
......@@ -61,7 +60,6 @@ class InfoBubble;
// Views toolkit implementation of the Autofill dialog that handles the
// imperative autocomplete API call.
class AutofillDialogViews : public AutofillDialogView,
public TestableAutofillDialogView,
public views::DialogDelegateView,
public views::WidgetObserver,
public views::TextfieldController,
......@@ -97,23 +95,8 @@ class AutofillDialogViews : public AutofillDialogView,
virtual const content::NavigationController* ShowSignIn() OVERRIDE;
virtual void HideSignIn() OVERRIDE;
virtual void ModelChanged() OVERRIDE;
virtual TestableAutofillDialogView* GetTestableView() OVERRIDE;
virtual void OnSignInResize(const gfx::Size& pref_size) OVERRIDE;
// TestableAutofillDialogView implementation:
virtual void SubmitForTesting() OVERRIDE;
virtual void CancelForTesting() OVERRIDE;
virtual base::string16 GetTextContentsOfInput(ServerFieldType type) OVERRIDE;
virtual void SetTextContentsOfInput(ServerFieldType type,
const base::string16& contents) OVERRIDE;
virtual void SetTextContentsOfSuggestionInput(
DialogSection section,
const base::string16& text) OVERRIDE;
virtual void ActivateInput(ServerFieldType type) OVERRIDE;
virtual gfx::Size GetSize() const OVERRIDE;
virtual content::WebContents* GetSignInWebContents() OVERRIDE;
virtual bool IsShowingOverlay() const OVERRIDE;
// views::View implementation.
virtual gfx::Size GetPreferredSize() OVERRIDE;
virtual gfx::Size GetMinimumSize() OVERRIDE;
......@@ -178,6 +161,8 @@ class AutofillDialogViews : public AutofillDialogView,
views::View* GetScrollableAreaForTesting();
private:
friend class AutofillDialogViewTesterViews;
// What the entire dialog should be doing (e.g. gathering info from the user,
// asking the user to sign in, etc.).
enum DialogMode {
......
......@@ -1410,6 +1410,7 @@
'browser/ui/autofill/test_generated_credit_card_bubble_view.h',
'browser/ui/autofill/test_generated_credit_card_bubble_controller.cc',
'browser/ui/autofill/test_generated_credit_card_bubble_controller.h',
'browser/ui/autofill/autofill_dialog_view_tester.h',
'browser/ui/blocked_content/popup_blocker_browsertest.cc',
'browser/ui/bookmarks/bookmark_browsertest.cc',
'browser/ui/browser_browsertest.cc',
......@@ -1423,6 +1424,8 @@
'browser/ui/cocoa/apps/app_shim_menu_controller_mac_browsertest.mm',
'browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm',
'browser/ui/cocoa/autofill/autofill_dialog_cocoa_browsertest.mm',
'browser/ui/cocoa/autofill/autofill_dialog_view_tester_cocoa.mm',
'browser/ui/cocoa/autofill/autofill_dialog_view_tester_cocoa.h',
'browser/ui/cocoa/browser_window_cocoa_browsertest.mm',
'browser/ui/cocoa/browser_window_controller_browsertest.mm',
'browser/ui/cocoa/certificate_viewer_mac_browsertest.mm',
......@@ -1464,6 +1467,8 @@
'browser/ui/toolbar/test_toolbar_model.cc',
'browser/ui/toolbar/test_toolbar_model.h',
'browser/ui/views/avatar_menu_button_browsertest.cc',
'browser/ui/views/autofill/autofill_dialog_view_tester_views.cc',
'browser/ui/views/autofill/autofill_dialog_view_tester_views.h',
'browser/ui/views/frame/browser_non_client_frame_view_ash_browsertest.cc',
'browser/ui/views/frame/browser_view_browsertest.cc',
'browser/ui/views/frame/browser_window_property_manager_browsertest_win.cc',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment