| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_PANELS_PANEL_SCROLLER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_PANELS_PANEL_SCROLLER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_PANELS_PANEL_SCROLLER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_PANELS_PANEL_SCROLLER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/slide_animation.h" | 10 #include "app/slide_animation.h" |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 31 virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled); | 31 virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled); |
| 32 | 32 |
| 33 // Called when a panel header is clicked with the affected container. This | 33 // Called when a panel header is clicked with the affected container. This |
| 34 // function will make sure the panel is fully visible. | 34 // function will make sure the panel is fully visible. |
| 35 void HeaderClicked(PanelScrollerHeader* source); | 35 void HeaderClicked(PanelScrollerHeader* source); |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 struct Panel; | 38 struct Panel; |
| 39 | 39 |
| 40 // AnimationDelegate overrides. | 40 // AnimationDelegate overrides. |
| 41 virtual void AnimationEnded(const Animation* animation); | |
| 42 virtual void AnimationProgressed(const Animation* animation); | 41 virtual void AnimationProgressed(const Animation* animation); |
| 43 virtual void AnimationCanceled(const Animation* animation); | |
| 44 | 42 |
| 45 // Scrolls to the panel at the given index. It will be moved to the top. | 43 // Scrolls to the panel at the given index. It will be moved to the top. |
| 46 void ScrollToPanel(int index); | 44 void ScrollToPanel(int index); |
| 47 | 45 |
| 48 // All panels in this scroller. | 46 // All panels in this scroller. |
| 49 std::vector<Panel*> panels_; | 47 std::vector<Panel*> panels_; |
| 50 | 48 |
| 51 // Height in pixels of the headers above each panel. | 49 // Height in pixels of the headers above each panel. |
| 52 int divider_height_; | 50 int divider_height_; |
| 53 | 51 |
| 54 bool needs_layout_; | 52 bool needs_layout_; |
| 55 | 53 |
| 56 // The current scroll position. | 54 // The current scroll position. |
| 57 int scroll_pos_; | 55 int scroll_pos_; |
| 58 | 56 |
| 59 SlideAnimation animation_; | 57 SlideAnimation animation_; |
| 60 | 58 |
| 61 // When animating a scroll, these indicate the beginning and ending of the | 59 // When animating a scroll, these indicate the beginning and ending of the |
| 62 // scroll. The scroll_pos_ always indicates the current one. | 60 // scroll. The scroll_pos_ always indicates the current one. |
| 63 int animated_scroll_begin_; | 61 int animated_scroll_begin_; |
| 64 int animated_scroll_end_; | 62 int animated_scroll_end_; |
| 65 | 63 |
| 66 DISALLOW_COPY_AND_ASSIGN(PanelScroller); | 64 DISALLOW_COPY_AND_ASSIGN(PanelScroller); |
| 67 }; | 65 }; |
| 68 | 66 |
| 69 #endif // CHROME_BROWSER_CHROMEOS_PANELS_PANEL_SCROLLER_H_ | 67 #endif // CHROME_BROWSER_CHROMEOS_PANELS_PANEL_SCROLLER_H_ |
| 70 | 68 |
| OLD | NEW |