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

Unified Diff: chrome/browser/ui/touch/tabs/touch_tab_strip_controller.h

Issue 7065052: Improve large tab strip by leveraging touch icons when present (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed extra line Created 9 years, 6 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/ui/touch/tabs/touch_tab_strip_controller.h
diff --git a/chrome/browser/ui/touch/tabs/touch_tab_strip_controller.h b/chrome/browser/ui/touch/tabs/touch_tab_strip_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..22adf9809d82791f09bff4c09aa14b4112a945c6
--- /dev/null
+++ b/chrome/browser/ui/touch/tabs/touch_tab_strip_controller.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2011 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_TOUCH_TABS_TOUCH_TAB_STRIP_CONTROLLER_H_
+#define CHROME_BROWSER_UI_TOUCH_TABS_TOUCH_TAB_STRIP_CONTROLLER_H_
+#pragma once
+
+#include <map>
+
+#include "chrome/browser/favicon/favicon_service.h"
+#include "chrome/browser/history/history.h"
+#include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h"
+
+class Profile;
+
+// Subclassing BrowserTabStripController to provide touch specific behavior.
+class TouchTabStripController: public BrowserTabStripController {
+ public:
+ TouchTabStripController(Browser* browser, TabStripModel* model);
+ virtual ~TouchTabStripController();
+
+ virtual void TabChangedAt(TabContentsWrapper* contents, int model_index,
sky 2011/06/09 16:53:00 nit: if you have to wrap, then put each param on i
Emmanuel Saint-loubert-Bié 2011/06/10 02:21:45 Done.
+ TabChangeType change_type) OVERRIDE;
+
+ void OnTouchIconAvailable(FaviconService::Handle h,
sky 2011/06/09 16:53:00 make this private.
Emmanuel Saint-loubert-Bié 2011/06/10 02:21:45 Done.
+ history::FaviconData favicon);
+
+ protected:
+ virtual void SetTabRendererDataFromModel(TabContents* contents,
+ int model_index, TabRendererData* data) OVERRIDE;
+
+ private:
+
sky 2011/06/09 16:53:00 nit: no newline here.
Emmanuel Saint-loubert-Bié 2011/06/10 02:21:45 Done.
+ // Profile obtained from Browser object in constructor.
+ Profile* profile_;
sky 2011/06/09 16:53:00 Remove this and make profile() in BrowserTabStripC
Emmanuel Saint-loubert-Bié 2011/06/10 02:21:45 Cool and done.
+
+ // Mapping of model index to URLS and URLs to Touch Icons
+ typedef std::map<int, GURL> ModelIndexMap;
sky 2011/06/09 16:53:00 If you cache by model index it means you have to t
Emmanuel Saint-loubert-Bié 2011/06/10 02:21:45 You are right of course using the model that way i
+ ModelIndexMap model_index_map_;
+ typedef std::map<GURL, SkBitmap> TouchIconMap;
+ TouchIconMap touch_icon_map_;
+
+ // Our consumer for touch icon requests (takes the model_index as data)
+ CancelableRequestConsumerT<int, 0> consumer_;
+
+ DISALLOW_COPY_AND_ASSIGN(TouchTabStripController);
+};
+
+#endif // CHROME_BROWSER_UI_TOUCH_TABS_TOUCH_TAB_STRIP_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698