summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/panels/panel_scroller.h
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-22 23:41:24 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-22 23:41:24 +0000
commitae25f9f425e0e652e0d72edf6fb5d080d5760f3b (patch)
tree702d964850ddbf39389014d65d2d39dda8dcbb43 /chrome/browser/chromeos/panels/panel_scroller.h
parent61eeb15a8909da1141c10316d8cf8c6841ed29d1 (diff)
downloadchromium_src-ae25f9f425e0e652e0d72edf6fb5d080d5760f3b.zip
chromium_src-ae25f9f425e0e652e0d72edf6fb5d080d5760f3b.tar.gz
chromium_src-ae25f9f425e0e652e0d72edf6fb5d080d5760f3b.tar.bz2
* Moved panel controller to chromeos directory
* Include BrowserExtender to regular build to remove CHROMEOS ifdefs in BrowserView * moved browser_extender.h to chrome/browser/views/frame, and BrowserExtender methods to chrome/browser/views/frame/browser_extender.cc. * Added StandardExtender (standard_extender.cc), which is empty now. I'm going to add MainMenu support to win, which will be added vua StandardExtender with a command line flag. * factory method "Create" is now defined in standard_extender.cc and chromeos/chromeos_browser_extenders.cc. toolkit_views=1 uses chromeos_browser_extenders.cc and other build uses standard_extender BUG=None TEST=None Review URL: http://codereview.chromium.org/317001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29836 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/panels/panel_scroller.h')
-rw-r--r--chrome/browser/chromeos/panels/panel_scroller.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/chrome/browser/chromeos/panels/panel_scroller.h b/chrome/browser/chromeos/panels/panel_scroller.h
new file mode 100644
index 0000000..a3db3db
--- /dev/null
+++ b/chrome/browser/chromeos/panels/panel_scroller.h
@@ -0,0 +1,70 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
+// source code is governed by a BSD-style license that can be found in the
+// LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_PANELS_PANEL_SCROLLER_H_
+#define CHROME_BROWSER_CHROMEOS_PANELS_PANEL_SCROLLER_H_
+
+#include <vector>
+
+#include "app/slide_animation.h"
+#include "base/basictypes.h"
+#include "views/view.h"
+
+class PanelScrollerHeader;
+
+class PanelScroller : public views::View, public AnimationDelegate {
+ public:
+ PanelScroller();
+ ~PanelScroller();
+
+ static PanelScroller* CreateWindow();
+
+ // View overrides.
+ virtual void ViewHierarchyChanged(bool is_add,
+ views::View* parent,
+ views::View* child);
+ virtual gfx::Size GetPreferredSize();
+ virtual void Layout();
+ virtual bool OnMousePressed(const views::MouseEvent& event);
+ virtual bool OnMouseDragged(const views::MouseEvent& event);
+ virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled);
+
+ // Called when a panel header is clicked with the affected container. This
+ // function will make sure the panel is fully visible.
+ void HeaderClicked(PanelScrollerHeader* source);
+
+ private:
+ struct Panel;
+
+ // AnimationDelegate overrides.
+ virtual void AnimationEnded(const Animation* animation);
+ virtual void AnimationProgressed(const Animation* animation);
+ virtual void AnimationCanceled(const Animation* animation);
+
+ // Scrolls to the panel at the given index. It will be moved to the top.
+ void ScrollToPanel(int index);
+
+ // All panels in this scroller.
+ std::vector<Panel*> panels_;
+
+ // Height in pixels of the headers above each panel.
+ int divider_height_;
+
+ bool needs_layout_;
+
+ // The current scroll position.
+ int scroll_pos_;
+
+ SlideAnimation animation_;
+
+ // When animating a scroll, these indicate the beginning and ending of the
+ // scroll. The scroll_pos_ always indicates the current one.
+ int animated_scroll_begin_;
+ int animated_scroll_end_;
+
+ DISALLOW_COPY_AND_ASSIGN(PanelScroller);
+};
+
+#endif // CHROME_BROWSER_CHROMEOS_PANELS_PANEL_SCROLLER_H_
+