| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/toolbar/back_button.h" | 5 #include "chrome/browser/ui/views/toolbar/back_button.h" |
| 6 | 6 |
| 7 #include "ui/gfx/geometry/insets.h" | 7 #include "ui/gfx/geometry/insets.h" |
| 8 #include "ui/views/animation/ink_drop_animation_controller.h" | 8 #include "ui/views/animation/ink_drop_animation_controller.h" |
| 9 #include "ui/views/controls/button/label_button_border.h" | 9 #include "ui/views/controls/button/label_button_border.h" |
| 10 #include "ui/views/painter.h" | 10 #include "ui/views/painter.h" |
| 11 | 11 |
| 12 BackButton::BackButton(views::ButtonListener* listener, | 12 BackButton::BackButton(Profile* profile, |
| 13 views::ButtonListener* listener, |
| 13 ui::MenuModel* model) | 14 ui::MenuModel* model) |
| 14 : ToolbarButton(listener, model), | 15 : ToolbarButton(profile, listener, model), margin_leading_(0) {} |
| 15 margin_leading_(0) {} | |
| 16 | 16 |
| 17 BackButton::~BackButton() {} | 17 BackButton::~BackButton() {} |
| 18 | 18 |
| 19 void BackButton::SetLeadingMargin(int margin) { | 19 void BackButton::SetLeadingMargin(int margin) { |
| 20 margin_leading_ = margin; | 20 margin_leading_ = margin; |
| 21 | 21 |
| 22 UpdateThemedBorder(); | 22 UpdateThemedBorder(); |
| 23 | 23 |
| 24 const int inset = LabelButton::kFocusRectInset; | 24 const int inset = LabelButton::kFocusRectInset; |
| 25 const bool is_rtl = base::i18n::IsRTL(); | 25 const bool is_rtl = base::i18n::IsRTL(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 55 return border.Pass(); | 55 return border.Pass(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 gfx::Rect BackButton::GetThemePaintRect() const { | 58 gfx::Rect BackButton::GetThemePaintRect() const { |
| 59 gfx::Rect rect(LabelButton::GetThemePaintRect()); | 59 gfx::Rect rect(LabelButton::GetThemePaintRect()); |
| 60 const bool is_rtl = base::i18n::IsRTL(); | 60 const bool is_rtl = base::i18n::IsRTL(); |
| 61 rect.Inset(is_rtl ? 0 : margin_leading_, 0, is_rtl ? margin_leading_ : 0, 0); | 61 rect.Inset(is_rtl ? 0 : margin_leading_, 0, is_rtl ? margin_leading_ : 0, 0); |
| 62 return rect; | 62 return rect; |
| 63 } | 63 } |
| 64 | 64 |
| OLD | NEW |