| 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
|
|
|
|
|