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

Unified Diff: chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc

Issue 1138653003: Move card unmask interfaces and controller into the autofill component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix missing override declaration Created 5 years, 7 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
« no previous file with comments | « chrome/browser/ui/views/autofill/card_unmask_prompt_views.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc
diff --git a/chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc b/chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc
index 0952195da30e5eb6241d865fa7f5b57d9908bd0a..c1038f103d1eb16ebbb15cb1428284265703b6ba 100644
--- a/chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc
+++ b/chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc
@@ -7,10 +7,11 @@
#include "base/basictypes.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/autofill/autofill_dialog_types.h"
-#include "chrome/browser/ui/autofill/card_unmask_prompt_controller.h"
+#include "chrome/browser/ui/autofill/create_card_unmask_prompt_view.h"
#include "chrome/browser/ui/views/autofill/decorated_textfield.h"
#include "chrome/browser/ui/views/autofill/tooltip_icon.h"
#include "chrome/grit/generated_resources.h"
+#include "components/autofill/core/browser/ui/card_unmask_prompt_controller.h"
#include "components/constrained_window/constrained_window_views.h"
#include "components/web_modal/web_contents_modal_dialog_host.h"
#include "components/web_modal/web_contents_modal_dialog_manager.h"
@@ -41,17 +42,17 @@ const int kEdgePadding = 19;
SkColor kGreyTextColor = SkColorSetRGB(0x64, 0x64, 0x64);
-// static
-CardUnmaskPromptView* CardUnmaskPromptView::CreateAndShow(
- CardUnmaskPromptController* controller) {
- CardUnmaskPromptViews* view = new CardUnmaskPromptViews(controller);
- view->Show();
- return view;
+CardUnmaskPromptView* CreateCardUnmaskPromptView(
+ CardUnmaskPromptController* controller,
+ content::WebContents* web_contents) {
+ return new CardUnmaskPromptViews(controller, web_contents);
}
CardUnmaskPromptViews::CardUnmaskPromptViews(
- CardUnmaskPromptController* controller)
+ CardUnmaskPromptController* controller,
+ content::WebContents* web_contents)
: controller_(controller),
+ web_contents_(web_contents),
main_contents_(nullptr),
permanent_error_label_(nullptr),
input_row_(nullptr),
@@ -76,8 +77,7 @@ CardUnmaskPromptViews::~CardUnmaskPromptViews() {
}
void CardUnmaskPromptViews::Show() {
- constrained_window::ShowWebModalDialogViews(this,
- controller_->GetWebContents());
+ constrained_window::ShowWebModalDialogViews(this, web_contents_);
}
void CardUnmaskPromptViews::ControllerGone() {
@@ -169,12 +169,12 @@ void CardUnmaskPromptViews::SetRetriableErrorMessage(
}
// Update the dialog's size.
- if (GetWidget() && controller_->GetWebContents()) {
+ if (GetWidget() && web_contents_) {
constrained_window::UpdateWebContentsModalDialogPosition(
- GetWidget(), web_modal::WebContentsModalDialogManager::FromWebContents(
- controller_->GetWebContents())
- ->delegate()
- ->GetWebContentsModalDialogHost());
+ GetWidget(),
+ web_modal::WebContentsModalDialogManager::FromWebContents(web_contents_)
+ ->delegate()
+ ->GetWebContentsModalDialogHost());
}
Layout();
« no previous file with comments | « chrome/browser/ui/views/autofill/card_unmask_prompt_views.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698