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

Unified Diff: components/autofill/core/browser/ui/autofill_dialog_types.cc

Issue 974323002: Componentize autofill dialog common code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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: components/autofill/core/browser/ui/autofill_dialog_types.cc
diff --git a/chrome/browser/ui/autofill/autofill_dialog_types.cc b/components/autofill/core/browser/ui/autofill_dialog_types.cc
similarity index 83%
rename from chrome/browser/ui/autofill/autofill_dialog_types.cc
rename to components/autofill/core/browser/ui/autofill_dialog_types.cc
index 2e4793d2106332e3c77ceebbd29fcf20f519c9fb..3254890b7d72c27cd7ecbb9e465278594a9728f4 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_types.cc
+++ b/components/autofill/core/browser/ui/autofill_dialog_types.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/ui/autofill/autofill_dialog_types.h"
+#include "components/autofill/core/browser/ui/autofill_dialog_types.h"
#include "base/logging.h"
#include "base/strings/string_split.h"
@@ -25,16 +25,15 @@ static const base::char16 kRangeSeparator = '|';
bool DetailInput::IsMultiline() const {
return (type == ADDRESS_HOME_STREET_ADDRESS ||
type == ADDRESS_BILLING_STREET_ADDRESS) &&
- length == DetailInput::LONG;
+ length == DetailInput::LONG;
}
-DialogNotification::DialogNotification() : type_(NONE) {}
+DialogNotification::DialogNotification() : type_(NONE) {
+}
DialogNotification::DialogNotification(Type type,
const base::string16& display_text)
- : type_(type),
- display_text_(display_text),
- checked_(false) {
+ : type_(type), display_text_(display_text), checked_(false) {
// If there's a range separated by bars, mark that as the anchor text.
std::vector<base::string16> pieces;
base::SplitStringDontTrim(display_text, kRangeSeparator, &pieces);
@@ -46,7 +45,8 @@ DialogNotification::DialogNotification(Type type,
}
}
-DialogNotification::~DialogNotification() {}
+DialogNotification::~DialogNotification() {
+}
SkColor DialogNotification::GetBackgroundColor() const {
switch (type_) {
@@ -110,8 +110,8 @@ bool DialogNotification::HasCheckbox() const {
SkColor const kWarningColor = SkColorSetRGB(0xde, 0x49, 0x32);
-SuggestionState::SuggestionState()
- : visible(false) {}
+SuggestionState::SuggestionState() : visible(false) {
+}
SuggestionState::SuggestionState(
bool visible,
const base::string16& vertically_compact_text,
@@ -124,25 +124,35 @@ SuggestionState::SuggestionState(
horizontally_compact_text(horizontally_compact_text),
icon(icon),
extra_text(extra_text),
- extra_icon(extra_icon) {}
-SuggestionState::~SuggestionState() {}
+ extra_icon(extra_icon) {
+}
+SuggestionState::~SuggestionState() {
+}
-DialogOverlayString::DialogOverlayString() {}
-DialogOverlayString::~DialogOverlayString() {}
+DialogOverlayString::DialogOverlayString() {
+}
+DialogOverlayString::~DialogOverlayString() {
+}
-DialogOverlayState::DialogOverlayState() {}
-DialogOverlayState::~DialogOverlayState() {}
+DialogOverlayState::DialogOverlayState() {
+}
+DialogOverlayState::~DialogOverlayState() {
+}
ValidityMessage::ValidityMessage(const base::string16& text, bool sure)
- : text(text), sure(sure) {}
-ValidityMessage::~ValidityMessage() {}
+ : text(text), sure(sure) {
+}
+ValidityMessage::~ValidityMessage() {
+}
ValidityMessages::ValidityMessages()
- : default_message_(ValidityMessage(base::string16(), false)) {}
-ValidityMessages::~ValidityMessages() {}
+ : default_message_(ValidityMessage(base::string16(), false)) {
+}
+ValidityMessages::~ValidityMessages() {
+}
-void ValidityMessages::Set(
- ServerFieldType field, const ValidityMessage& message) {
+void ValidityMessages::Set(ServerFieldType field,
+ const ValidityMessage& message) {
MessageMap::iterator iter = messages_.find(field);
if (iter != messages_.end()) {
if (!iter->second.text.empty())
@@ -174,8 +184,8 @@ bool ValidityMessages::HasErrors() const {
}
bool ValidityMessages::HasSureErrors() const {
- for (MessageMap::const_iterator iter = messages_.begin();
- iter != messages_.end(); ++iter) {
+ for (MessageMap::const_iterator iter = messages_.begin();
+ iter != messages_.end(); ++iter) {
if (IsSureError(iter->second))
return true;
}

Powered by Google App Engine
This is Rietveld 408576698