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

Unified Diff: chrome/browser/sidebar/sidebar_model.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
« no previous file with comments | « chrome/browser/sidebar/sidebar_manager.cc ('k') | chrome/browser/ui/cocoa/browser_window_cocoa.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chrome/browser/sidebar/sidebar_manager.cc ('k') | chrome/browser/ui/cocoa/browser_window_cocoa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698