diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-23 03:02:12 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-23 03:02:12 +0000 |
commit | 12e02fab8ec3e85bdb2e6c60116fc53d95b18ce0 (patch) | |
tree | 9c6fe120014a832b05ad138cb36bf43ccbac0424 /chrome/browser | |
parent | 1ee59cb007ee9ed5aced09853b1976871857e16d (diff) | |
download | chromium_src-12e02fab8ec3e85bdb2e6c60116fc53d95b18ce0.zip chromium_src-12e02fab8ec3e85bdb2e6c60116fc53d95b18ce0.tar.gz chromium_src-12e02fab8ec3e85bdb2e6c60116fc53d95b18ce0.tar.bz2 |
views: Move the remaining layout constants to the views namespace. Final Part.
BUG=None
TEST=trybots
Review URL: http://codereview.chromium.org/6538076
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75703 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
21 files changed, 112 insertions, 100 deletions
diff --git a/chrome/browser/speech/speech_input_bubble_views.cc b/chrome/browser/speech/speech_input_bubble_views.cc index 9b33685..0fca89b 100644 --- a/chrome/browser/speech/speech_input_bubble_views.cc +++ b/chrome/browser/speech/speech_input_bubble_views.cc @@ -139,7 +139,7 @@ gfx::Size ContentView::GetPreferredSize() { int height = cancel_->GetPreferredSize().height(); if (message_->IsVisible()) { height += message_->GetHeightForWidth(width) + - kLabelToControlVerticalSpacing; + views::kLabelToControlVerticalSpacing; } else { height += heading_->GetPreferredSize().height() + icon_->GetImage().height(); diff --git a/chrome/browser/ui/views/about_chrome_view.cc b/chrome/browser/ui/views/about_chrome_view.cc index 4b2cf5a..8813a27 100644 --- a/chrome/browser/ui/views/about_chrome_view.cc +++ b/chrome/browser/ui/views/about_chrome_view.cc @@ -295,13 +295,13 @@ void AboutChromeView::Init() { // Add up the height of the various elements on the page. int height = about_background_logo->height() + - views::kRelatedControlVerticalSpacing + - // Copyright line. - font.GetHeight() + - // Main label. - dummy_text.GetHeightForWidth( - dialog_dimensions_.width() - (2 * kPanelHorizMargin)) + - views::kRelatedControlVerticalSpacing; + views::kRelatedControlVerticalSpacing + + // Copyright line. + font.GetHeight() + + // Main label. + dummy_text.GetHeightForWidth( + dialog_dimensions_.width() - (2 * views::kPanelHorizMargin)) + + views::kRelatedControlVerticalSpacing; #if defined(GOOGLE_CHROME_BUILD) std::vector<size_t> url_offsets; @@ -347,12 +347,13 @@ void AboutChromeView::Layout() { // First label goes to the top left corner. sz = about_title_label_->GetPreferredSize(); - about_title_label_->SetBounds(kPanelHorizMargin, kPanelVertMargin, - sz.width(), sz.height()); + about_title_label_->SetBounds( + views::kPanelHorizMargin, views::kPanelVertMargin, + sz.width(), sz.height()); // Then we have the version number right below it. sz = version_label_->GetPreferredSize(); - version_label_->SetBounds(kPanelHorizMargin, + version_label_->SetBounds(views::kPanelHorizMargin, about_title_label_->y() + about_title_label_->height() + views::kRelatedControlVerticalSpacing, @@ -363,7 +364,7 @@ void AboutChromeView::Layout() { // Then we have the version number right below it. sz = os_version_label_->GetPreferredSize(); os_version_label_->SetBounds( - kPanelHorizMargin, + views::kPanelHorizMargin, version_label_->y() + version_label_->height() + views::kRelatedControlVerticalSpacing, @@ -374,16 +375,16 @@ void AboutChromeView::Layout() { // For the width of the main text label we want to use up the whole panel // width and remaining height, minus a little margin on each side. int y_pos = background_image_height + views::kRelatedControlVerticalSpacing; - sz.set_width(panel_size.width() - 2 * kPanelHorizMargin); + sz.set_width(panel_size.width() - 2 * views::kPanelHorizMargin); // Draw the text right below the background image. - copyright_label_->SetBounds(kPanelHorizMargin, + copyright_label_->SetBounds(views::kPanelHorizMargin, y_pos, sz.width(), sz.height()); // Then the main_text_label. - main_text_label_->SetBounds(kPanelHorizMargin, + main_text_label_->SetBounds(views::kPanelHorizMargin, copyright_label_->y() + copyright_label_->height(), sz.width(), @@ -394,7 +395,7 @@ void AboutChromeView::Layout() { gfx::Rect parent_bounds = parent()->GetContentsBounds(); sz = throbber_->GetPreferredSize(); - int throbber_topleft_x = kPanelHorizMargin; + int throbber_topleft_x = views::kPanelHorizMargin; int throbber_topleft_y = parent_bounds.bottom() - sz.height() - views::kButtonVEdgeMargin - 3; throbber_->SetBounds(throbber_topleft_x, throbber_topleft_y, diff --git a/chrome/browser/ui/views/bookmark_editor_view.cc b/chrome/browser/ui/views/bookmark_editor_view.cc index bc94312..9a685c2 100644 --- a/chrome/browser/ui/views/bookmark_editor_view.cc +++ b/chrome/browser/ui/views/bookmark_editor_view.cc @@ -143,8 +143,8 @@ void BookmarkEditorView::Layout() { gfx::Size prefsize = new_group_button_->GetPreferredSize(); int button_y = parent_bounds.bottom() - prefsize.height() - views::kButtonVEdgeMargin; - new_group_button_->SetBounds(kPanelHorizMargin, button_y, prefsize.width(), - prefsize.height()); + new_group_button_->SetBounds( + views::kPanelHorizMargin, button_y, prefsize.width(), prefsize.height()); } gfx::Size BookmarkEditorView::GetPreferredSize() { diff --git a/chrome/browser/ui/views/clear_browsing_data.cc b/chrome/browser/ui/views/clear_browsing_data.cc index 3b572c2..ca85a4fc 100644 --- a/chrome/browser/ui/views/clear_browsing_data.cc +++ b/chrome/browser/ui/views/clear_browsing_data.cc @@ -148,11 +148,11 @@ void ClearBrowsingDataView::Init() { throbber_view_->SetLayoutManager(layout); views::ColumnSet* column_set = layout->AddColumnSet(0); // DialogClientView positions the extra view at kButtonHEdgeMargin, but we - // put all our controls at kPanelHorizMargin. Add a padding column so things - // line up nicely. - if (kPanelHorizMargin - views::kButtonHEdgeMargin > 0) { + // put all our controls at views::kPanelHorizMargin. Add a padding column so + // things line up nicely. + if (views::kPanelHorizMargin - views::kButtonHEdgeMargin > 0) { column_set->AddPaddingColumn( - 0, kPanelHorizMargin - views::kButtonHEdgeMargin); + 0, views::kPanelHorizMargin - views::kButtonHEdgeMargin); } column_set->AddColumn(GridLayout::CENTER, GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0); @@ -178,47 +178,48 @@ void ClearBrowsingDataView::Layout() { // Delete All label goes to the top left corner. gfx::Size sz = delete_all_label_->GetPreferredSize(); - delete_all_label_->SetBounds(kPanelHorizMargin, kPanelVertMargin, - sz.width(), sz.height()); + delete_all_label_->SetBounds( + views::kPanelHorizMargin, views::kPanelVertMargin, + sz.width(), sz.height()); // Check-boxes go beneath it (with a little indentation). sz = del_history_checkbox_->GetPreferredSize(); - del_history_checkbox_->SetBounds(2 * kPanelHorizMargin, + del_history_checkbox_->SetBounds(2 * views::kPanelHorizMargin, delete_all_label_->y() + delete_all_label_->height() + views::kRelatedControlVerticalSpacing, sz.width(), sz.height()); sz = del_downloads_checkbox_->GetPreferredSize(); - del_downloads_checkbox_->SetBounds(2 * kPanelHorizMargin, + del_downloads_checkbox_->SetBounds(2 * views::kPanelHorizMargin, del_history_checkbox_->y() + del_history_checkbox_->height() + views::kRelatedControlVerticalSpacing, sz.width(), sz.height()); sz = del_cache_checkbox_->GetPreferredSize(); - del_cache_checkbox_->SetBounds(2 * kPanelHorizMargin, + del_cache_checkbox_->SetBounds(2 * views::kPanelHorizMargin, del_downloads_checkbox_->y() + del_downloads_checkbox_->height() + views::kRelatedControlVerticalSpacing, sz.width(), sz.height()); sz = del_cookies_checkbox_->GetPreferredSize(); - del_cookies_checkbox_->SetBounds(2 * kPanelHorizMargin, + del_cookies_checkbox_->SetBounds(2 * views::kPanelHorizMargin, del_cache_checkbox_->y() + del_cache_checkbox_->height() + views::kRelatedControlVerticalSpacing, sz.width(), sz.height()); sz = del_passwords_checkbox_->GetPreferredSize(); - del_passwords_checkbox_->SetBounds(2 * kPanelHorizMargin, + del_passwords_checkbox_->SetBounds(2 * views::kPanelHorizMargin, del_cookies_checkbox_->y() + del_cookies_checkbox_->height() + views::kRelatedControlVerticalSpacing, sz.width(), sz.height()); sz = del_form_data_checkbox_->GetPreferredSize(); - del_form_data_checkbox_->SetBounds(2 * kPanelHorizMargin, + del_form_data_checkbox_->SetBounds(2 * views::kPanelHorizMargin, del_passwords_checkbox_->y() + del_passwords_checkbox_->height() + views::kRelatedControlVerticalSpacing, @@ -226,7 +227,7 @@ void ClearBrowsingDataView::Layout() { // Time period label is next below the combo boxes. sz = time_period_label_->GetPreferredSize(); - time_period_label_->SetBounds(kPanelHorizMargin, + time_period_label_->SetBounds(views::kPanelHorizMargin, del_form_data_checkbox_->y() + del_form_data_checkbox_->height() + views::kRelatedControlVerticalSpacing + @@ -341,7 +342,7 @@ views::ClientView* ClearBrowsingDataView::CreateClientView( views::View* settings_view = new views::View(); GridLayout* layout = new GridLayout(settings_view); layout->SetInsets( - gfx::Insets(0, kPanelHorizMargin, 0, views::kButtonHEdgeMargin)); + gfx::Insets(0, views::kPanelHorizMargin, 0, views::kButtonHEdgeMargin)); settings_view->SetLayoutManager(layout); views::ColumnSet* column_set = layout->AddColumnSet(0); column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1, diff --git a/chrome/browser/ui/views/clear_browsing_data_view.cc b/chrome/browser/ui/views/clear_browsing_data_view.cc index 6fbcabb..70c0ae4 100644 --- a/chrome/browser/ui/views/clear_browsing_data_view.cc +++ b/chrome/browser/ui/views/clear_browsing_data_view.cc @@ -141,11 +141,11 @@ void ClearBrowsingDataView2::Init() { views::ColumnSet* column_set = layout->AddColumnSet(0); // DialogClientView positions the extra view at kButtonHEdgeMargin, but we - // put all our controls at kPanelHorizMargin. Add a padding column so things - // line up nicely. - if (kPanelHorizMargin - views::kButtonHEdgeMargin > 0) { + // put all our controls at views::kPanelHorizMargin. Add a padding column so + // things line up nicely. + if (views::kPanelHorizMargin - views::kButtonHEdgeMargin > 0) { column_set->AddPaddingColumn( - 0, kPanelHorizMargin - views::kButtonHEdgeMargin); + 0, views::kPanelHorizMargin - views::kButtonHEdgeMargin); } column_set->AddColumn(GridLayout::CENTER, GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0); diff --git a/chrome/browser/ui/views/clear_server_data.cc b/chrome/browser/ui/views/clear_server_data.cc index 86d12b4..7d10151 100644 --- a/chrome/browser/ui/views/clear_server_data.cc +++ b/chrome/browser/ui/views/clear_server_data.cc @@ -143,7 +143,7 @@ void ClearServerDataView::InitControlLayout() { layout->StartRow(0, left_aligned_column_set_id); layout->AddView(flash_link_); - layout->AddPaddingRow(0, kPanelVertMargin); + layout->AddPaddingRow(0, views::kPanelVertMargin); AddWrappingLabelRow(layout, chrome_sync_title_label_, centered_column_set_id, true); @@ -157,7 +157,7 @@ void ClearServerDataView::InitControlLayout() { GridLayout::LEADING, GridLayout::CENTER); layout->AddView(throbber_, 1, 1, GridLayout::TRAILING, GridLayout::CENTER); - layout->AddPaddingRow(0, kPanelVertMargin); + layout->AddPaddingRow(0, views::kPanelVertMargin); AddWrappingLabelRow(layout, dashboard_label_, centered_column_set_id, true); diff --git a/chrome/browser/ui/views/confirm_message_box_dialog.cc b/chrome/browser/ui/views/confirm_message_box_dialog.cc index c79c347..82d615a 100644 --- a/chrome/browser/ui/views/confirm_message_box_dialog.cc +++ b/chrome/browser/ui/views/confirm_message_box_dialog.cc @@ -95,8 +95,8 @@ bool ConfirmMessageBoxDialog::Cancel() { void ConfirmMessageBoxDialog::Layout() { gfx::Size sz = message_label_->GetPreferredSize(); - message_label_->SetBounds(kPanelHorizMargin, kPanelVertMargin, - width() - 2 * kPanelHorizMargin, + message_label_->SetBounds(views::kPanelHorizMargin, views::kPanelVertMargin, + width() - 2 * views::kPanelHorizMargin, sz.height()); } diff --git a/chrome/browser/ui/views/content_setting_bubble_contents.cc b/chrome/browser/ui/views/content_setting_bubble_contents.cc index 47589e1..6a9473c 100644 --- a/chrome/browser/ui/views/content_setting_bubble_contents.cc +++ b/chrome/browser/ui/views/content_setting_bubble_contents.cc @@ -283,7 +283,8 @@ void ContentSettingBubbleContents::InitControlLayout() { // Insert a column set to indent the domain list. views::ColumnSet* indented_single_column_set = layout->AddColumnSet(indented_single_column_set_id); - indented_single_column_set->AddPaddingColumn(0, kPanelHorizIndentation); + indented_single_column_set->AddPaddingColumn( + 0, views::kPanelHorizIndentation); indented_single_column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 1, GridLayout::USE_PREF, 0, 0); for (std::vector<ContentSettingBubbleModel::DomainList>::const_iterator i = diff --git a/chrome/browser/ui/views/create_application_shortcut_view.cc b/chrome/browser/ui/views/create_application_shortcut_view.cc index b4e59ca..e08bc3d 100644 --- a/chrome/browser/ui/views/create_application_shortcut_view.cc +++ b/chrome/browser/ui/views/create_application_shortcut_view.cc @@ -280,11 +280,11 @@ void CreateApplicationShortcutView::InitControls() { layout->StartRow(0, kHeaderColumnSetId); layout->AddView(app_info_); - layout->AddPaddingRow(0, kPanelSubVerticalSpacing); + layout->AddPaddingRow(0, views::kPanelSubVerticalSpacing); layout->StartRow(0, kHeaderColumnSetId); layout->AddView(create_shortcuts_label_); - layout->AddPaddingRow(0, kLabelToControlVerticalSpacing); + layout->AddPaddingRow(0, views::kLabelToControlVerticalSpacing); layout->StartRow(0, kTableColumnSetId); layout->AddView(desktop_check_box_); diff --git a/chrome/browser/ui/views/default_search_view.cc b/chrome/browser/ui/views/default_search_view.cc index 2bc8967..84fe8d1 100644 --- a/chrome/browser/ui/views/default_search_view.cc +++ b/chrome/browser/ui/views/default_search_view.cc @@ -218,7 +218,7 @@ void DefaultSearchView::SetupControls(PrefService* prefs) { // Now set-up the dialog contents. GridLayout* layout = new views::GridLayout(this); - layout->SetInsets(0, 0, kPanelVertMargin, 0); + layout->SetInsets(0, 0, views::kPanelVertMargin, 0); SetLayoutManager(layout); // Add a column set that spans the whole dialog. @@ -233,15 +233,15 @@ void DefaultSearchView::SetupControls(PrefService* prefs) { // Add a column set that spans the whole dialog but obeying padding. ColumnSet* padded_whole_dialog_column_set = layout->AddColumnSet(kPaddedWholeDialogViewSetId); - padded_whole_dialog_column_set->AddPaddingColumn(1, kPanelVertMargin); + padded_whole_dialog_column_set->AddPaddingColumn(1, views::kPanelVertMargin); padded_whole_dialog_column_set->AddColumn( GridLayout::LEADING, GridLayout::LEADING, 1, GridLayout::USE_PREF, 0, 0); - padded_whole_dialog_column_set->AddPaddingColumn(1, kPanelVertMargin); + padded_whole_dialog_column_set->AddPaddingColumn(1, views::kPanelVertMargin); // Add a column set for the search engine choices. ColumnSet* choices_column_set = layout->AddColumnSet(kChoicesViewSetId); - choices_column_set->AddPaddingColumn(1, kPanelVertMargin); + choices_column_set->AddPaddingColumn(1, views::kPanelVertMargin); choices_column_set->AddColumn(GridLayout::CENTER, GridLayout::CENTER, 1, GridLayout::USE_PREF, 0, 0); choices_column_set->AddPaddingColumn( @@ -249,7 +249,7 @@ void DefaultSearchView::SetupControls(PrefService* prefs) { choices_column_set->AddColumn(GridLayout::CENTER, GridLayout::CENTER, 1, GridLayout::USE_PREF, 0, 0); choices_column_set->LinkColumnSizes(0, 2, -1); - choices_column_set->AddPaddingColumn(1, kPanelVertMargin); + choices_column_set->AddPaddingColumn(1, views::kPanelVertMargin); // Add the "search box" image. layout->StartRow(0, kWholeDialogViewSetId); @@ -264,7 +264,7 @@ void DefaultSearchView::SetupControls(PrefService* prefs) { // Add text informing the user about the requested default change. layout->StartRowWithPadding(0, kPaddedWholeDialogViewSetId, - 1, kLabelToControlVerticalSpacing); + 1, views::kLabelToControlVerticalSpacing); Label* summary_label = new Label(UTF16ToWide(l10n_util::GetStringFUTF16( IDS_DEFAULT_SEARCH_SUMMARY, WideToUTF16(proposed_short_name)))); diff --git a/chrome/browser/ui/views/extensions/extension_install_prompt.cc b/chrome/browser/ui/views/extensions/extension_install_prompt.cc index 4cf5954..7b510b6 100644 --- a/chrome/browser/ui/views/extensions/extension_install_prompt.cc +++ b/chrome/browser/ui/views/extensions/extension_install_prompt.cc @@ -95,24 +95,25 @@ class InstallDialogContent : public views::View, public views::DialogDelegate { virtual gfx::Size GetPreferredSize() { int width = kRightColumnWidth; width += kIconSize; - width += kPanelHorizMargin * 3; + width += views::kPanelHorizMargin * 3; - int height = kPanelVertMargin * 2; + int height = views::kPanelVertMargin * 2; height += heading_->GetHeightForWidth(kRightColumnWidth); - return gfx::Size(width, std::max(height, kIconSize + kPanelVertMargin * 2)); + return gfx::Size(width, + std::max(height, kIconSize + views::kPanelVertMargin * 2)); } virtual void Layout() { - int x = kPanelHorizMargin; - int y = kPanelVertMargin; + int x = views::kPanelHorizMargin; + int y = views::kPanelVertMargin; heading_->SizeToFit(kRightColumnWidth); if (heading_->height() <= kIconSize) { icon_->SetBounds(x, y, kIconSize, kIconSize); x += kIconSize; - x += kPanelHorizMargin; + x += views::kPanelHorizMargin; heading_->SetX(x); heading_->SetY(y + (kIconSize - heading_->height()) / 2); @@ -122,7 +123,7 @@ class InstallDialogContent : public views::View, public views::DialogDelegate { kIconSize, kIconSize); x += kIconSize; - x += kPanelHorizMargin; + x += views::kPanelHorizMargin; heading_->SetX(x); heading_->SetY(y); diff --git a/chrome/browser/ui/views/extensions/extension_install_prompt2.cc b/chrome/browser/ui/views/extensions/extension_install_prompt2.cc index 92069af..a0c4b56 100644 --- a/chrome/browser/ui/views/extensions/extension_install_prompt2.cc +++ b/chrome/browser/ui/views/extensions/extension_install_prompt2.cc @@ -214,12 +214,12 @@ views::View* InstallDialogContent2::GetContentsView() { } gfx::Size InstallDialogContent2::GetPreferredSize() { - int width = kPanelHorizMargin * 2; + int width = views::kPanelHorizMargin * 2; width += kIconSize; - width += kPanelHorizMargin; // Gutter. + width += views::kPanelHorizMargin; // Gutter. width += right_column_width_; - int height = kPanelVertMargin * 2; + int height = views::kPanelVertMargin * 2; height += heading_->GetHeightForWidth(right_column_width_); if (permission_box_) { @@ -237,16 +237,17 @@ gfx::Size InstallDialogContent2::GetPreferredSize() { } } - return gfx::Size(width, std::max(height, kIconSize + kPanelVertMargin * 2)); + return gfx::Size(width, + std::max(height, kIconSize + views::kPanelVertMargin * 2)); } void InstallDialogContent2::Layout() { - int x = kPanelHorizMargin; - int y = kPanelVertMargin; + int x = views::kPanelHorizMargin; + int y = views::kPanelVertMargin; icon_->SetBounds(x, y, kIconSize, kIconSize); x += kIconSize; - x += kPanelHorizMargin; + x += views::kPanelHorizMargin; heading_->SizeToFit(right_column_width_); heading_->SetX(x); @@ -282,7 +283,7 @@ void InstallDialogContent2::Layout() { for (size_t i = 0; i < permissions_.size(); ++i) { if (i > 0) { label_y += views::kRelatedControlVerticalSpacing; - permission_box_height += kPanelVertMargin; + permission_box_height += views::kPanelVertMargin; } permissions_[i]->SizeToFit(kPermissionLabelWidth); diff --git a/chrome/browser/ui/views/extensions/extension_installed_bubble.cc b/chrome/browser/ui/views/extensions/extension_installed_bubble.cc index 148aedd..9ea61f3 100644 --- a/chrome/browser/ui/views/extensions/extension_installed_bubble.cc +++ b/chrome/browser/ui/views/extensions/extension_installed_bubble.cc @@ -41,11 +41,11 @@ const int kRightColumnWidth = 285; // around the content view. We compensate by reducing our outer borders by this // amount + 4px. const int kOuterMarginInset = 10; -const int kHorizOuterMargin = kPanelHorizMargin - kOuterMarginInset; -const int kVertOuterMargin = kPanelVertMargin - kOuterMarginInset; +const int kHorizOuterMargin = views::kPanelHorizMargin - kOuterMarginInset; +const int kVertOuterMargin = views::kPanelVertMargin - kOuterMarginInset; // Interior vertical margin is 8px smaller than standard -const int kVertInnerMargin = kPanelVertMargin - 8; +const int kVertInnerMargin = views::kPanelVertMargin - 8; // The image we use for the close button has three pixels of whitespace padding. const int kCloseButtonPadding = 3; @@ -161,9 +161,9 @@ class InstalledBubbleContent : public views::View, virtual gfx::Size GetPreferredSize() { int width = kHorizOuterMargin; width += kIconSize; - width += kPanelHorizMargin; + width += views::kPanelHorizMargin; width += kRightColumnWidth; - width += 2*kPanelHorizMargin; + width += 2 * views::kPanelHorizMargin; width += kHorizOuterMargin; int height = kVertOuterMargin; @@ -186,7 +186,7 @@ class InstalledBubbleContent : public views::View, icon_->SetBounds(x, y, kIconSize, kIconSize); x += kIconSize; - x += kPanelHorizMargin; + x += views::kPanelHorizMargin; y += kRightcolumnVerticalShift; heading_->SizeToFit(kRightColumnWidth); @@ -211,7 +211,7 @@ class InstalledBubbleContent : public views::View, y += kVertInnerMargin; gfx::Size sz; - x += kRightColumnWidth + 2 * kPanelHorizMargin + kHorizOuterMargin - + x += kRightColumnWidth + 2 * views::kPanelHorizMargin + kHorizOuterMargin - close_button_->GetPreferredSize().width(); y = kVertOuterMargin; sz = close_button_->GetPreferredSize(); diff --git a/chrome/browser/ui/views/first_run_bubble.cc b/chrome/browser/ui/views/first_run_bubble.cc index 802979a..d9ed8dbb 100644 --- a/chrome/browser/ui/views/first_run_bubble.cc +++ b/chrome/browser/ui/views/first_run_bubble.cc @@ -183,7 +183,7 @@ void FirstRunBubbleView::Layout() { pref_size.height()); next_v_space = label2_->y() + label2_->height() + - kPanelSubVerticalSpacing; + views::kPanelSubVerticalSpacing; pref_size = label3_->GetPreferredSize(); label3_->SetBounds(kBubblePadding, next_v_space, diff --git a/chrome/browser/ui/views/first_run_search_engine_view.cc b/chrome/browser/ui/views/first_run_search_engine_view.cc index b1bcecf..a66c6b5 100644 --- a/chrome/browser/ui/views/first_run_search_engine_view.cc +++ b/chrome/browser/ui/views/first_run_search_engine_view.cc @@ -293,7 +293,7 @@ void FirstRunSearchEngineView::SetupControls() { AddChildView(background_image_); - int label_width = GetPreferredSize().width() - 2 * kPanelHorizMargin; + int label_width = GetPreferredSize().width() - 2 * views::kPanelHorizMargin; // Add title and text asking the user to choose a search engine: title_label_ = new Label(UTF16ToWide(l10n_util::GetStringUTF16( @@ -330,18 +330,21 @@ void FirstRunSearchEngineView::Layout() { const double kUpperPaddingPercent = 0.4; int num_choices = search_engine_choices_.size(); - int label_width = GetPreferredSize().width() - 2 * kPanelHorizMargin; - int label_height = GetPreferredSize().height() - 2 * kPanelVertMargin; + int label_width = GetPreferredSize().width() - 2 * views::kPanelHorizMargin; + int label_height = GetPreferredSize().height() - 2 * views::kPanelVertMargin; // Set title. - title_label_->SetBounds(kPanelHorizMargin, + title_label_->SetBounds( + views::kPanelHorizMargin, pref_size.height() / 2 - title_label_->GetPreferredSize().height() / 2, - label_width, title_label_->GetPreferredSize().height()); + label_width, + title_label_->GetPreferredSize().height()); int next_v_space = background_image_->height() + kVertSpacing * 2; // Set text describing search engine hooked into omnibox. - text_label_->SetBounds(kPanelHorizMargin, next_v_space, + text_label_->SetBounds(views::kPanelHorizMargin, + next_v_space, label_width, text_label_->GetPreferredSize().height()); next_v_space = text_label_->y() + @@ -365,7 +368,7 @@ void FirstRunSearchEngineView::Layout() { int upper_logo_margin = static_cast<int>((label_height - logo_section_height - background_image_->height() - text_label_->height() - - kVertSpacing + kPanelVertMargin) * kUpperPaddingPercent); + - kVertSpacing + views::kPanelVertMargin) * kUpperPaddingPercent); next_v_space = text_label_->y() + text_label_->height() + upper_logo_margin; @@ -375,7 +378,7 @@ void FirstRunSearchEngineView::Layout() { (label_width - (num_choices * logo_width)) / (num_choices + 1); search_engine_choices_[0]->SetChoiceViewBounds( - kPanelHorizMargin + logo_padding, next_v_space, logo_width, + views::kPanelHorizMargin + logo_padding, next_v_space, logo_width, logo_height); int next_h_space = search_engine_choices_[0]->GetView()->x() + @@ -403,9 +406,9 @@ void FirstRunSearchEngineView::Layout() { // The buttons for search engine selection: int button_padding = logo_padding + logo_width / 2 - button_width / 2; - search_engine_choices_[0]->SetBounds(kPanelHorizMargin + button_padding, - next_v_space, button_width, - button_height); + search_engine_choices_[0]->SetBounds( + views::kPanelHorizMargin + button_padding, next_v_space, + button_width, button_height); next_h_space = search_engine_choices_[0]->x() + logo_width + logo_padding; search_engine_choices_[1]->SetBounds(next_h_space, next_v_space, diff --git a/chrome/browser/ui/views/hung_renderer_view.cc b/chrome/browser/ui/views/hung_renderer_view.cc index 65a3478..918e19b 100644 --- a/chrome/browser/ui/views/hung_renderer_view.cc +++ b/chrome/browser/ui/views/hung_renderer_view.cc @@ -408,7 +408,7 @@ void HungRendererDialogView::CreateKillButtonView() { const int single_column_set_id = 0; ColumnSet* column_set = layout->AddColumnSet(single_column_set_id); column_set->AddPaddingColumn(0, frozen_icon_->width() + - kPanelHorizMargin + views::kUnrelatedControlHorizontalSpacing); + views::kPanelHorizMargin + views::kUnrelatedControlHorizontalSpacing); column_set->AddColumn(GridLayout::LEADING, GridLayout::LEADING, 0, GridLayout::USE_PREF, 0, 0); diff --git a/chrome/browser/ui/views/importer_lock_view.cc b/chrome/browser/ui/views/importer_lock_view.cc index 2230a21..5c23edd 100644 --- a/chrome/browser/ui/views/importer_lock_view.cc +++ b/chrome/browser/ui/views/importer_lock_view.cc @@ -56,9 +56,11 @@ gfx::Size ImporterLockView::GetPreferredSize() { } void ImporterLockView::Layout() { - description_label_->SetBounds(kPanelHorizMargin, kPanelVertMargin, - width() - 2 * kPanelHorizMargin, - height() - 2 * kPanelVertMargin); + description_label_->SetBounds( + views::kPanelHorizMargin, + views::kPanelVertMargin, + width() - 2 * views::kPanelHorizMargin, + height() - 2 * views::kPanelVertMargin); } std::wstring ImporterLockView::GetDialogButtonLabel( diff --git a/chrome/browser/ui/views/options/cookies_view.cc b/chrome/browser/ui/views/options/cookies_view.cc index 24c8ccc..5079266 100644 --- a/chrome/browser/ui/views/options/cookies_view.cc +++ b/chrome/browser/ui/views/options/cookies_view.cc @@ -180,7 +180,7 @@ void CookiesView::Layout() { int y_buttons = parent_bounds.bottom() - ps.height() - views::kButtonVEdgeMargin; - remove_button_->SetBounds(kPanelHorizMargin, y_buttons, ps.width(), + remove_button_->SetBounds(views::kPanelHorizMargin, y_buttons, ps.width(), ps.height()); ps = remove_all_button_->GetPreferredSize(); diff --git a/chrome/browser/ui/views/options/exceptions_view.cc b/chrome/browser/ui/views/options/exceptions_view.cc index 67ff3b6..0ab6aaf 100644 --- a/chrome/browser/ui/views/options/exceptions_view.cc +++ b/chrome/browser/ui/views/options/exceptions_view.cc @@ -85,7 +85,7 @@ void ExceptionsView::Layout() { // The buttons are placed in the parent, but we need to lay them out. int max_y = parent()->GetContentsBounds().bottom() - views::kButtonVEdgeMargin; - int x = kPanelHorizMargin; + int x = views::kPanelHorizMargin; for (size_t i = 0; i < arraysize(buttons); ++i) { gfx::Size pref = buttons[i]->GetPreferredSize(); diff --git a/chrome/browser/ui/views/options/simple_content_exceptions_view.cc b/chrome/browser/ui/views/options/simple_content_exceptions_view.cc index 5dc1d3e..0c3e0fe 100644 --- a/chrome/browser/ui/views/options/simple_content_exceptions_view.cc +++ b/chrome/browser/ui/views/options/simple_content_exceptions_view.cc @@ -71,7 +71,7 @@ void SimpleContentExceptionsView::Layout() { // The buttons are placed in the parent, but we need to lay them out. int max_y = parent()->GetContentsBounds().bottom() - views::kButtonVEdgeMargin; - int x = kPanelHorizMargin; + int x = views::kPanelHorizMargin; for (size_t i = 0; i < arraysize(buttons); ++i) { gfx::Size pref = buttons[i]->GetPreferredSize(); diff --git a/chrome/browser/ui/views/task_manager_view.cc b/chrome/browser/ui/views/task_manager_view.cc index 9b2c6c7..442eb96 100644 --- a/chrome/browser/ui/views/task_manager_view.cc +++ b/chrome/browser/ui/views/task_manager_view.cc @@ -505,27 +505,29 @@ void TaskManagerView::ViewHierarchyChanged(bool is_add, } void TaskManagerView::Layout() { - // kPanelHorizMargin is too big. + // views::kPanelHorizMargin is too big. const int kTableButtonSpacing = 12; gfx::Size size = kill_button_->GetPreferredSize(); int prefered_width = size.width(); int prefered_height = size.height(); - tab_table_->SetBounds(x() + kPanelHorizMargin, - y() + kPanelVertMargin, - width() - 2 * kPanelHorizMargin, - height() - 2 * kPanelVertMargin - prefered_height); + tab_table_->SetBounds( + x() + views::kPanelHorizMargin, + y() + views::kPanelVertMargin, + width() - 2 * views::kPanelHorizMargin, + height() - 2 * views::kPanelVertMargin - prefered_height); // y-coordinate of button top left. gfx::Rect parent_bounds = parent()->GetContentsBounds(); int y_buttons = parent_bounds.bottom() - prefered_height - views::kButtonVEdgeMargin; - kill_button_->SetBounds(x() + width() - prefered_width - kPanelHorizMargin, - y_buttons, - prefered_width, - prefered_height); + kill_button_->SetBounds( + x() + width() - prefered_width - views::kPanelHorizMargin, + y_buttons, + prefered_width, + prefered_height); if (purge_memory_button_) { size = purge_memory_button_->GetPreferredSize(); @@ -542,7 +544,7 @@ void TaskManagerView::Layout() { // bottom of buttons vertically. int link_y_offset = std::max(0, prefered_height - link_prefered_height) / 2; about_memory_link_->SetBounds( - x() + kPanelHorizMargin, + x() + views::kPanelHorizMargin, y_buttons + prefered_height - link_prefered_height - link_y_offset, link_prefered_width, link_prefered_height); |