| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tabs/side_tab_strip.h" | 5 #include "chrome/browser/ui/views/tabs/side_tab_strip.h" |
| 6 | 6 |
| 7 #include "chrome/browser/tabs/tab_strip_selection_model.h" | 7 #include "chrome/browser/tabs/tab_strip_selection_model.h" |
| 8 #include "chrome/browser/ui/view_ids.h" | 8 #include "chrome/browser/ui/view_ids.h" |
| 9 #include "chrome/browser/ui/views/tabs/side_tab.h" | 9 #include "chrome/browser/ui/views/tabs/side_tab.h" |
| 10 #include "chrome/browser/ui/views/tabs/tab_strip_controller.h" | 10 #include "chrome/browser/ui/views/tabs/tab_strip_controller.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 } | 71 } |
| 72 | 72 |
| 73 // Button class used for the scroll buttons. | 73 // Button class used for the scroll buttons. |
| 74 class ScrollButton : public views::TextButton { | 74 class ScrollButton : public views::TextButton { |
| 75 public: | 75 public: |
| 76 enum Type { | 76 enum Type { |
| 77 UP, | 77 UP, |
| 78 DOWN | 78 DOWN |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 explicit ScrollButton(views::ButtonListener* listener, Type type); | 81 ScrollButton(views::ButtonListener* listener, Type type); |
| 82 | 82 |
| 83 protected: | 83 protected: |
| 84 // views::View overrides. | 84 // views::View overrides. |
| 85 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 85 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
| 86 | 86 |
| 87 private: | 87 private: |
| 88 const Type type_; | 88 const Type type_; |
| 89 | 89 |
| 90 DISALLOW_COPY_AND_ASSIGN(ScrollButton); | 90 DISALLOW_COPY_AND_ASSIGN(ScrollButton); |
| 91 }; | 91 }; |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 return; | 459 return; |
| 460 | 460 |
| 461 if (ideal_bounds(tab_index).y() < kTabStripInset) { | 461 if (ideal_bounds(tab_index).y() < kTabStripInset) { |
| 462 SetFirstTabYOffset(first_tab_y_offset_ - ideal_bounds(tab_index).y() + | 462 SetFirstTabYOffset(first_tab_y_offset_ - ideal_bounds(tab_index).y() + |
| 463 kTabStripInset); | 463 kTabStripInset); |
| 464 } else if (ideal_bounds(tab_index).bottom() > GetMaxTabY()) { | 464 } else if (ideal_bounds(tab_index).bottom() > GetMaxTabY()) { |
| 465 SetFirstTabYOffset(GetMaxTabY() - (ideal_bounds(tab_index).bottom() - | 465 SetFirstTabYOffset(GetMaxTabY() - (ideal_bounds(tab_index).bottom() - |
| 466 first_tab_y_offset_)); | 466 first_tab_y_offset_)); |
| 467 } | 467 } |
| 468 } | 468 } |
| OLD | NEW |