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

Unified Diff: chrome/browser/ui/views/toolbar/toolbar_button.cc

Issue 2555623002: Last round of cleaning up MD layout constants. (Closed)
Patch Set: pkasting review, remove debug code, rebase Created 4 years 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/toolbar/toolbar_button.h ('k') | chrome/browser/ui/views/toolbar/toolbar_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/toolbar/toolbar_button.cc
diff --git a/chrome/browser/ui/views/toolbar/toolbar_button.cc b/chrome/browser/ui/views/toolbar/toolbar_button.cc
index 00e427c500ba6dfb5d3778db8621be4d9013d3e2..57fb60de60a70a9b46e05451c3d969c7e43a7b94 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_button.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_button.cc
@@ -12,8 +12,6 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/themes/theme_service_factory.h"
-#include "chrome/browser/ui/layout_constants.h"
-#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/menu_model.h"
@@ -57,16 +55,10 @@ bool ToolbarButton::IsMenuShowing() const {
}
gfx::Size ToolbarButton::GetPreferredSize() const {
- gfx::Size size(image()->GetPreferredSize());
- gfx::Size label_size = label()->GetPreferredSize();
- if (label_size.width() > 0) {
- size.Enlarge(
- label_size.width() + GetLayoutConstant(LOCATION_BAR_HORIZONTAL_PADDING),
- 0);
- }
- const int pad = GetLayoutConstant(TOOLBAR_BUTTON_PADDING);
- size.Enlarge(2 * pad, 2 * pad);
- return size;
+ DCHECK(label()->text().empty());
+ gfx::Rect rect(gfx::Size(image()->GetPreferredSize()));
+ rect.Inset(gfx::Insets(-kInteriorPadding));
+ return rect.size();
}
bool ToolbarButton::OnMousePressed(const ui::MouseEvent& event) {
@@ -150,7 +142,7 @@ std::unique_ptr<views::LabelButtonBorder> ToolbarButton::CreateDefaultBorder()
views::LabelButton::CreateDefaultBorder();
if (ThemeServiceFactory::GetForProfile(profile_)->UsingSystemTheme())
- border->set_insets(gfx::Insets(GetLayoutConstant(TOOLBAR_BUTTON_PADDING)));
+ border->set_insets(gfx::Insets(kInteriorPadding));
return border;
}
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_button.h ('k') | chrome/browser/ui/views/toolbar/toolbar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698