| OLD | NEW |
| 1 // Copyright (c) 2010 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 #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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "ui/base/animation/animation_delegate.h" | 12 #include "ui/base/animation/animation_delegate.h" |
| 13 #include "ui/base/animation/slide_animation.h" | 13 #include "ui/base/animation/slide_animation.h" |
| 14 #include "views/view.h" | 14 #include "views/view.h" |
| 15 | 15 |
| 16 class PanelScrollerHeader; | 16 class PanelScrollerHeader; |
| 17 | 17 |
| 18 class PanelScroller : public views::View, public ui::AnimationDelegate { | 18 class PanelScroller : public views::View, public ui::AnimationDelegate { |
| 19 public: | 19 public: |
| 20 PanelScroller(); | 20 PanelScroller(); |
| 21 ~PanelScroller(); | 21 ~PanelScroller(); |
| 22 | 22 |
| 23 static PanelScroller* CreateWindow(); | 23 static PanelScroller* CreateWindow(); |
| 24 | 24 |
| 25 // View overrides. | 25 // Overridden from View: |
| 26 virtual void ViewHierarchyChanged(bool is_add, | 26 virtual void ViewHierarchyChanged(bool is_add, |
| 27 views::View* parent, | 27 views::View* parent, |
| 28 views::View* child); | 28 views::View* child) OVERRIDE; |
| 29 virtual gfx::Size GetPreferredSize(); | 29 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 30 virtual void Layout(); | 30 virtual void Layout() OVERRIDE; |
| 31 virtual bool OnMousePressed(const views::MouseEvent& event); | 31 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; |
| 32 virtual bool OnMouseDragged(const views::MouseEvent& event); | 32 virtual bool OnMouseDragged(const views::MouseEvent& event) OVERRIDE; |
| 33 virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled); | |
| 34 | 33 |
| 35 // Called when a panel header is clicked with the affected container. This | 34 // Called when a panel header is clicked with the affected container. This |
| 36 // function will make sure the panel is fully visible. | 35 // function will make sure the panel is fully visible. |
| 37 void HeaderClicked(PanelScrollerHeader* source); | 36 void HeaderClicked(PanelScrollerHeader* source); |
| 38 | 37 |
| 39 private: | 38 private: |
| 40 struct Panel; | 39 struct Panel; |
| 41 | 40 |
| 42 // ui::AnimationDelegate overrides. | 41 // ui::AnimationDelegate overrides. |
| 43 virtual void AnimationProgressed(const ui::Animation* animation); | 42 virtual void AnimationProgressed(const ui::Animation* animation); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 61 // When animating a scroll, these indicate the beginning and ending of the | 60 // When animating a scroll, these indicate the beginning and ending of the |
| 62 // scroll. The scroll_pos_ always indicates the current one. | 61 // scroll. The scroll_pos_ always indicates the current one. |
| 63 int animated_scroll_begin_; | 62 int animated_scroll_begin_; |
| 64 int animated_scroll_end_; | 63 int animated_scroll_end_; |
| 65 | 64 |
| 66 DISALLOW_COPY_AND_ASSIGN(PanelScroller); | 65 DISALLOW_COPY_AND_ASSIGN(PanelScroller); |
| 67 }; | 66 }; |
| 68 | 67 |
| 69 #endif // CHROME_BROWSER_CHROMEOS_PANELS_PANEL_SCROLLER_H_ | 68 #endif // CHROME_BROWSER_CHROMEOS_PANELS_PANEL_SCROLLER_H_ |
| 70 | 69 |
| OLD | NEW |