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

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: Fixed URL to ignore fragment and changed item handling 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..24dd07eaeea9786e9404ffda9a369eb75720e4fc
--- /dev/null
+++ b/chrome/browser/ui/touch/tabs/touch_tab_strip_controller.h
@@ -0,0 +1,48 @@
+// 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 <vector>
+
+#include "chrome/browser/favicon/favicon_service.h"
+#include "chrome/browser/history/history.h"
+#include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h"
+
+// 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,
+ TabChangeType change_type) OVERRIDE;
+
+ protected:
+ virtual void SetTabRendererDataFromModel(TabContents* contents,
+ int model_index,
+ TabRendererData* data) OVERRIDE;
+
+ private:
+ void OnTouchIconAvailable(FaviconService::Handle h,
+ history::FaviconData favicon);
+
+ // A vector of all GURL requests and the model index to be refreshed
+ typedef std::pair<GURL, int> RequestInfo;
sky 2011/06/10 15:38:18 typedefs should be first in a section (http://www.
Emmanuel Saint-loubert-Bié 2011/06/10 16:09:10 sorry I did cut and paste from another similar dec
+ std::vector<RequestInfo> gurl_vector_;
+
+ typedef std::map<GURL, SkBitmap> TouchIconMap;
+ TouchIconMap touch_icon_map_;
+
+ // Our consumer for touch icon requests (takes gurl_vector_ 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