| Index: chrome/browser/sidebar/sidebar_model.h
|
| ===================================================================
|
| --- chrome/browser/sidebar/sidebar_model.h (revision 0)
|
| +++ chrome/browser/sidebar/sidebar_model.h (revision 0)
|
| @@ -0,0 +1,98 @@
|
| +// 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_SIDEBAR_SIDEBAR_MODEL_H_
|
| +#define CHROME_BROWSER_SIDEBAR_SIDEBAR_MODEL_H_
|
| +
|
| +#include <string>
|
| +#include <vector>
|
| +
|
| +#include "base/string16.h"
|
| +
|
| +class GURL;
|
| +class SidebarContainer;
|
| +class SkBitmap;
|
| +class TabContentsWrapper;
|
| +
|
| +// SidebarModel is a Chrome sidebar abstraction, it represents a connection
|
| +// between page tabs and sidebars defined for them.
|
| +// Provides an API for sidebar state enquires and manipulations, including
|
| +// functions backing chrome.experimental.sidebar API.
|
| +class SidebarModel {
|
| + public:
|
| + virtual ~SidebarModel() {}
|
| +
|
| + // Returns all sidebars defined for |tab| at once.
|
| + virtual std::vector<SidebarContainer*> GetAllSidebarsFor(
|
| + TabContentsWrapper* tab) = 0;
|
| +
|
| + // Returns SidebarContainer registered for |tab| and active or NULL if
|
| + // there is no alive and active SidebarContainer registered for |tab|.
|
| + virtual SidebarContainer* GetActiveSidebarContainerFor(
|
| + TabContentsWrapper* tab) = 0;
|
| +
|
| + // Returns SidebarContainer registered for |tab| and |content_id| or NULL if
|
| + // there is no such SidebarContainer registered.
|
| + virtual SidebarContainer* GetSidebarContainerFor(
|
| + TabContentsWrapper* tab,
|
| + const std::string& content_id) = 0;
|
| +
|
| + // Returns sidebar's TabContents registered for |tab| and |content_id|.
|
| + virtual TabContents* GetSidebarTabContents(TabContentsWrapper* tab,
|
| + const std::string& content_id) = 0;
|
| +
|
| + // Sends sidebar state change notification to extensions.
|
| + virtual void NotifyStateChanges(TabContents* was_active_sidebar_contents,
|
| + TabContents* active_sidebar_contents) = 0;
|
| +
|
| + // Expands/collapses sidebar identified by |tab| and |content_id|,
|
| + // depending on its current state (has no effect if sidebar is
|
| + // not shown).
|
| + virtual void ToggleSidebar(TabContentsWrapper* tab,
|
| + const std::string& content_id) = 0;
|
| +
|
| + // Functions supporting chrome.experimental.sidebar API.
|
| +
|
| + // Shows sidebar identified by |tab| and |content_id| (only sidebar's
|
| + // mini tab is visible).
|
| + virtual void ShowSidebar(TabContentsWrapper* tab,
|
| + const std::string& content_id) = 0;
|
| +
|
| + // Expands sidebar identified by |tab| and |content_id|.
|
| + virtual void ExpandSidebar(TabContentsWrapper* tab,
|
| + const std::string& content_id) = 0;
|
| +
|
| + // Collapses sidebar identified by |tab| and |content_id| (has no effect
|
| + // if sidebar is not expanded).
|
| + virtual void CollapseSidebar(TabContentsWrapper* tab,
|
| + const std::string& content_id) = 0;
|
| +
|
| + // Hides sidebar identified by |tab| and |content_id| (removes sidebar's
|
| + // mini tab).
|
| + virtual void HideSidebar(TabContentsWrapper* tab,
|
| + const std::string& content_id) = 0;
|
| +
|
| + // Navigates sidebar identified by |tab| and |content_id| to |url|.
|
| + virtual void NavigateSidebar(TabContentsWrapper* tab,
|
| + const std::string& content_id,
|
| + const GURL& url) = 0;
|
| +
|
| + // Changes sidebar's badge text (displayed on the mini tab).
|
| + virtual void SetSidebarBadgeText(TabContentsWrapper* tab,
|
| + const std::string& content_id,
|
| + const string16& badge_text) = 0;
|
| +
|
| + // Changes sidebar's icon (displayed on the mini tab).
|
| + virtual void SetSidebarIcon(TabContentsWrapper* tab,
|
| + const std::string& content_id,
|
| + const SkBitmap& bitmap) = 0;
|
| +
|
| + // Changes sidebar's title (mini tab's tooltip).
|
| + virtual void SetSidebarTitle(TabContentsWrapper* tab,
|
| + const std::string& content_id,
|
| + const string16& title) = 0;
|
| +};
|
| +
|
| +#endif // CHROME_BROWSER_SIDEBAR_SIDEBAR_MODEL_H_
|
| +
|
|
|
| Property changes on: chrome\browser\sidebar\sidebar_model.h
|
| ___________________________________________________________________
|
| Added: svn:eol-style
|
| + LF
|
|
|
|
|