Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_THUMBNAIL_GENERATOR_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_THUMBNAIL_GENERATOR_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_THUMBNAIL_GENERATOR_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_THUMBNAIL_GENERATOR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 134 ClipResult* clip_result); | 134 ClipResult* clip_result); |
| 135 | 135 |
| 136 // Update the thumbnail of the given tab contents if necessary. | 136 // Update the thumbnail of the given tab contents if necessary. |
| 137 void UpdateThumbnailIfNecessary(content::WebContents* webb_contents); | 137 void UpdateThumbnailIfNecessary(content::WebContents* webb_contents); |
| 138 | 138 |
| 139 // Update the thumbnail of the given tab. | 139 // Update the thumbnail of the given tab. |
| 140 void UpdateThumbnail(content::WebContents* web_contents, | 140 void UpdateThumbnail(content::WebContents* web_contents, |
| 141 const SkBitmap& bitmap, | 141 const SkBitmap& bitmap, |
| 142 const ThumbnailGenerator::ClipResult& clip_result); | 142 const ThumbnailGenerator::ClipResult& clip_result); |
| 143 | 143 |
| 144 // Returns true if we should update the thumbnail of the given URL. | 144 // Returns true if we should update the thumbnail of the given URL. |
|
mazda
2012/05/03 19:57:31
URL -> web contents
| |
| 145 static bool ShouldUpdateThumbnail(Profile* profile, | 145 static bool ShouldUpdateThumbnail(content::WebContents* web_contents); |
| 146 history::TopSites* top_sites, | |
| 147 const GURL& url); | |
| 148 | 146 |
| 149 // content::WebContentsObserver overrides. | 147 // content::WebContentsObserver overrides. |
| 150 virtual void DidStartLoading() OVERRIDE; | 148 virtual void DidStartLoading() OVERRIDE; |
| 151 virtual void StopNavigation() OVERRIDE; | 149 virtual void StopNavigation() OVERRIDE; |
| 152 | 150 |
| 153 private: | 151 private: |
| 154 virtual void WidgetDidReceivePaintAtSizeAck( | 152 virtual void WidgetDidReceivePaintAtSizeAck( |
| 155 content::RenderWidgetHost* widget, | 153 content::RenderWidgetHost* widget, |
| 156 int tag, | 154 int tag, |
| 157 const gfx::Size& size); | 155 const gfx::Size& size); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 191 bool load_interrupted_; | 189 bool load_interrupted_; |
| 192 | 190 |
| 193 base::WeakPtrFactory<ThumbnailGenerator> weak_factory_; | 191 base::WeakPtrFactory<ThumbnailGenerator> weak_factory_; |
| 194 scoped_ptr<base::WeakPtrFactory<content::WebContents> > | 192 scoped_ptr<base::WeakPtrFactory<content::WebContents> > |
| 195 web_contents_weak_factory_; | 193 web_contents_weak_factory_; |
| 196 | 194 |
| 197 DISALLOW_COPY_AND_ASSIGN(ThumbnailGenerator); | 195 DISALLOW_COPY_AND_ASSIGN(ThumbnailGenerator); |
| 198 }; | 196 }; |
| 199 | 197 |
| 200 #endif // CHROME_BROWSER_TAB_CONTENTS_THUMBNAIL_GENERATOR_H_ | 198 #endif // CHROME_BROWSER_TAB_CONTENTS_THUMBNAIL_GENERATOR_H_ |
| OLD | NEW |