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

Unified Diff: chrome/browser/sidebar/sidebar_container.h

Issue 6321006: Add "sidebar" section to extension manifest:... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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/sidebar/sidebar_container.h
===================================================================
--- chrome/browser/sidebar/sidebar_container.h (revision 71115)
+++ chrome/browser/sidebar/sidebar_container.h (working copy)
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/scoped_ptr.h"
#include "base/string16.h"
+#include "chrome/browser/extensions/image_loading_tracker.h"
#include "chrome/browser/tab_contents/tab_contents_delegate.h"
class BrowserWindow;
@@ -25,7 +26,8 @@
// tab it is linked to, mini tab icon, title etc.
//
class SidebarContainer
- : public TabContentsDelegate {
+ : public TabContentsDelegate,
+ private ImageLoadingTracker::Observer {
public:
// Interface to implement to listen for sidebar update notification.
class Delegate {
@@ -37,7 +39,8 @@
DISALLOW_COPY_AND_ASSIGN(Delegate);
};
- SidebarContainer(TabContents* tab, const std::string& content_id,
+ SidebarContainer(TabContents* tab,
+ const std::string& content_id,
Delegate* delegate);
virtual ~SidebarContainer();
@@ -45,6 +48,9 @@
// Does all the necessary cleanup.
void SidebarClosing();
+ // Sets default sidebar parameters, as specified in extension manifest.
+ void LoadDefaults();
+
// Returns sidebar's content id.
const std::string& content_id() const { return content_id_; }
@@ -110,6 +116,14 @@
virtual void UpdateTargetURL(TabContents* source, const GURL& url) {}
virtual void ToolbarSizeChanged(TabContents* source, bool is_animating) {}
+ // Overridden from ImageLoadingTracker::Observer.
+ virtual void OnImageLoaded(SkBitmap* image,
+ ExtensionResource resource,
+ int index);
+
+ // Returns an extension this sidebar belongs to.
+ const Extension* GetExtension() const;
+
// Contents of the tab this sidebar is linked to.
TabContents* tab_;
@@ -132,6 +146,13 @@
// Sidebar's title, displayed as a tooltip for sidebar's mini tab.
string16 title_;
+ bool navigate_to_default_url_on_expand_;
+ bool use_default_icon_;
+
+ // The object that is waiting for the sidebar images loading to complete
+ // asynchronously.
+ scoped_ptr<ImageLoadingTracker> image_loading_tracker_;
+
DISALLOW_COPY_AND_ASSIGN(SidebarContainer);
};

Powered by Google App Engine
This is Rietveld 408576698