Commit fb26394e authored by Oscar Johansson's avatar Oscar Johansson Committed by Commit Bot

Rename enums to avoid conflict (chrome/browser/ui)

The enums ColumnSetType are defined in both
views/passwords/password_pending_view.cc
and views/passwords/password_items_view.cc.
When building using Jumbo both declaration
ends up in the same namespace, causing a
conflict. This commits resolves the issue
by renaming the enums to something more
file specific.

Bug: 773275
Change-Id: I8f48b68df53166e910ab0beaf13ba80af63e40ae
Reviewed-on: https://chromium-review.googlesource.com/1102432Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#567661}
parent 7bbda190
......@@ -37,9 +37,10 @@ constexpr int kUndoButtonTag = 2;
// Column set identifiers for displaying or undoing removal of credentials.
// They both allocate space differently.
enum ColumnSetType { PASSWORD_COLUMN_SET, UNDO_COLUMN_SET };
enum PasswordItemsViewColumnSetType { PASSWORD_COLUMN_SET, UNDO_COLUMN_SET };
void BuildColumnSet(views::GridLayout* layout, ColumnSetType type_id) {
void BuildColumnSet(views::GridLayout* layout,
PasswordItemsViewColumnSetType type_id) {
DCHECK(!layout->GetColumnSet(type_id));
views::ColumnSet* column_set = layout->AddColumnSet(type_id);
// Passwords are split 60/40 (6:4) as the username is more important
......@@ -63,7 +64,8 @@ void BuildColumnSet(views::GridLayout* layout, ColumnSetType type_id) {
views::GridLayout::USE_PREF, 0, 0);
}
void StartRow(views::GridLayout* layout, ColumnSetType type_id) {
void StartRow(views::GridLayout* layout,
PasswordItemsViewColumnSetType type_id) {
if (!layout->GetColumnSet(type_id))
BuildColumnSet(layout, type_id);
layout->StartRow(0, type_id);
......
......@@ -40,7 +40,7 @@ namespace {
// TODO(pbos): Investigate expicitly obfuscating items inside ComboboxModel.
constexpr base::char16 kBulletChar = gfx::RenderText::kPasswordReplacementChar;
enum ColumnSetType {
enum PasswordPendingViewColumnSetType {
// | | (LEADING, FILL) | | (FILL, FILL) | |
// Used for the username/password line of the bubble, for the pending view.
DOUBLE_VIEW_COLUMN_SET_USERNAME,
......@@ -54,7 +54,8 @@ enum ColumnSetType {
// Construct an appropriate ColumnSet for the given |type|, and add it
// to |layout|.
void BuildColumnSet(views::GridLayout* layout, ColumnSetType type) {
void BuildColumnSet(views::GridLayout* layout,
PasswordPendingViewColumnSetType type) {
views::ColumnSet* column_set = layout->AddColumnSet(type);
const int column_divider = ChromeLayoutProvider::Get()->GetDistanceMetric(
views::DISTANCE_RELATED_CONTROL_HORIZONTAL);
......@@ -272,8 +273,9 @@ void PasswordPendingView::BuildCredentialRows(
DISTANCE_CONTROL_LIST_VERTICAL));
// Password row.
ColumnSetType type = password_view_button ? TRIPLE_VIEW_COLUMN_SET
: DOUBLE_VIEW_COLUMN_SET_PASSWORD;
PasswordPendingViewColumnSetType type = password_view_button
? TRIPLE_VIEW_COLUMN_SET
: DOUBLE_VIEW_COLUMN_SET_PASSWORD;
BuildColumnSet(layout, type);
layout->StartRow(0, type);
layout->AddView(password_label.release(), 1, 1, views::GridLayout::LEADING,
......
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