Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(729)

Unified Diff: chrome/browser/ui/views/sidebar/browser_sidebar_tab_strip_controller.h

Issue 6250141: Sidebar mini tabs UI (views version).... Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/sidebar/browser_sidebar_tab_strip_controller.h
===================================================================
--- chrome/browser/ui/views/sidebar/browser_sidebar_tab_strip_controller.h (revision 0)
+++ chrome/browser/ui/views/sidebar/browser_sidebar_tab_strip_controller.h (revision 0)
@@ -0,0 +1,87 @@
+// Copyright (c) 2010 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_UI_VIEWS_SIDEBAR_BROWSER_SIDEBAR_TAB_STRIP_CONTROLLER_H_
+#define CHROME_BROWSER_UI_VIEWS_SIDEBAR_BROWSER_SIDEBAR_TAB_STRIP_CONTROLLER_H_
+#pragma once
+
+#include <string>
+#include <vector>
+
+#include "base/scoped_ptr.h"
+#include "base/timer.h"
+#include "chrome/browser/ui/views/sidebar/sidebar_tab_strip_controller.h"
+
+class SidebarBaseTabStrip;
+class SidebarContainer;
+class SidebarModel;
+class TabContentsWrapper;
+
+struct SidebarTabRendererData;
+
+// An implementation of SidebarTabStripController that sources data from the
+// SidebarModel (SidebarManager and SidebarContainers are behind it)
+// and mediates BrowserView, SidebarModel and SidebarTabStrip interactions.
+class BrowserSidebarTabStripController : public SidebarTabStripController {
+ public:
+ BrowserSidebarTabStripController(SidebarModel* model, Delegate* delegate);
+ virtual ~BrowserSidebarTabStripController();
+
+ // SidebarTabStripController overrides:
+ virtual bool IsSidebarExpanded();
+ virtual bool IsTabSelected(int model_index);
+ virtual void SelectTab(int model_index);
+ virtual void UpdateTabs(TabContentsWrapper* tab);
+ virtual void UpdateState(const SidebarContainer* sidebar);
+ virtual void UpdateLoadingState(const SidebarContainer* sidebar);
+ virtual void TabStripBoundsChanged(bool is_animating);
+
+ void set_tab_strip(SidebarBaseTabStrip* tab_strip) {
+ tab_strip_ = tab_strip;
+ }
+
+ private:
+ friend class BrowserSidebarTabStripControllerTest;
+
+ SidebarModel* model() const { return model_; }
+
+ // Updates the loading animations of all mini tabs.
+ void UpdateLoadingAnimations();
+ // Callback for the loading animation(s) timer associated with this view.
+ void LoadingAnimationCallback();
+
+ // Invokes tab_strip_->SetTabData.
+ void SetTabDataAt(SidebarContainer* sidebar, int model_index);
+
+ // Sets the SidebarTabRendererData from the SidebarContainer.
+ void SetSidebarTabRendererDataFromModel(const SidebarContainer* sidebar,
+ SidebarTabRendererData* data);
+
+ // Non-owning pointer to the model.
+ SidebarModel* const model_;
+
+ // Non-owning pointer to the delegate to receive tab strip view size and shape
+ // updates.
+ Delegate* const delegate_;
+
+ // Non-owning pointer to the tab strip which owns this controller.
+ SidebarBaseTabStrip* tab_strip_;
+
+ // Page sidebar mini tabs are currently displayed for.
+ TabContentsWrapper* tab_;
+
+ // Mapping of the model ids (content ids, in sidebar terms) to the order
+ // of the tabs on the tab strip.
+ typedef std::vector<std::string> ModelIndex;
+ ModelIndex model_index_;
+
+ // The timer used to update frames for the "Loading" animation.
+ base::RepeatingTimer<BrowserSidebarTabStripController>
+ loading_animation_timer_;
+
+ DISALLOW_COPY_AND_ASSIGN(BrowserSidebarTabStripController);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_SIDEBAR_BROWSER_SIDEBAR_TAB_STRIP_CONTROLLER_H_
+
Property changes on: chrome\browser\ui\views\sidebar\browser_sidebar_tab_strip_controller.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698