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

Unified Diff: chrome/browser/sidebar/sidebar_container.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_browsertest.cc ('k') | chrome/browser/sidebar/sidebar_container.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sidebar/sidebar_container.h
===================================================================
--- chrome/browser/sidebar/sidebar_container.h (revision 74134)
+++ chrome/browser/sidebar/sidebar_container.h (working copy)
@@ -13,12 +13,21 @@
#include "chrome/browser/extensions/image_loading_tracker.h"
#include "chrome/browser/tab_contents/tab_contents_delegate.h"
-class BrowserWindow;
-class Profile;
-class RenderViewHost;
+class SidebarContainer;
class SkBitmap;
class TabContents;
+class TabContentsWrapper;
+struct SidebarChangedDetails {
+ enum UpdateType {
+ SIDEBAR_STATE_CHANGED,
+ SIDEBAR_PROPS_CHANGED,
+ SIDEBAR_LOADING_STATE_CHANGED
+ };
+ SidebarContainer* source;
+ UpdateType update_type;
+};
+
///////////////////////////////////////////////////////////////////////////////
// SidebarContainer
//
@@ -34,12 +43,12 @@
public:
Delegate() {}
virtual ~Delegate() {}
- virtual void UpdateSidebar(SidebarContainer* host) = 0;
+ virtual void UpdateSidebar(SidebarChangedDetails* details) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(Delegate);
};
- SidebarContainer(TabContents* tab,
+ SidebarContainer(TabContentsWrapper* tab,
const std::string& content_id,
Delegate* delegate);
virtual ~SidebarContainer();
@@ -54,8 +63,8 @@
// Returns sidebar's content id.
const std::string& content_id() const { return content_id_; }
- // Returns TabContents sidebar is linked to.
- TabContents* tab_contents() const { return tab_; }
+ // Returns TabContentsWrapper this sidebar is linked to.
+ TabContentsWrapper* tab() const { return tab_; }
// Returns sidebar's TabContents.
TabContents* sidebar_contents() const { return sidebar_contents_.get(); }
@@ -100,7 +109,7 @@
WindowOpenDisposition disposition,
PageTransition::Type transition) {}
virtual void NavigationStateChanged(const TabContents* source,
- unsigned changed_flags) {}
+ unsigned changed_flags);
virtual void AddNewContents(TabContents* source,
TabContents* new_contents,
WindowOpenDisposition disposition,
@@ -110,21 +119,29 @@
virtual void DeactivateContents(TabContents* contents) {}
virtual void LoadingStateChanged(TabContents* source) {}
virtual void CloseContents(TabContents* source) {}
- virtual void MoveContents(TabContents* source, const gfx::Rect& pos) {}
- virtual bool IsPopup(const TabContents* source) const;
+ virtual void MoveContents(TabContents* source,
+ const gfx::Rect& pos) {}
+ virtual void ToolbarSizeChanged(TabContents* source,
+ bool is_animating) {}
virtual void UpdateTargetURL(TabContents* source, const GURL& url) {}
- virtual void ToolbarSizeChanged(TabContents* source, bool is_animating) {}
+ virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
+ bool* is_keyboard_shortcut) OVERRIDE;
+ virtual void HandleKeyboardEvent(
+ const NativeWebKeyboardEvent& event) OVERRIDE;
// Overridden from ImageLoadingTracker::Observer.
virtual void OnImageLoaded(SkBitmap* image,
ExtensionResource resource,
int index);
+ // Forwards update notification to delegate_.
+ void NotifyUpdate(SidebarChangedDetails::UpdateType update_type);
+
// Returns an extension this sidebar belongs to.
const Extension* GetExtension() const;
// Contents of the tab this sidebar is linked to.
- TabContents* tab_;
+ TabContentsWrapper* tab_;
// Sidebar's content id. There might be more than one sidebar liked to each
// particular tab and they are identified by their unique content id.
« no previous file with comments | « chrome/browser/sidebar/sidebar_browsertest.cc ('k') | chrome/browser/sidebar/sidebar_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698