OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // desired width and the desired height. For instance, if the input | 108 // desired width and the desired height. For instance, if the input |
109 // bitmap is vertically long (ex. 400x900) and the desired size is | 109 // bitmap is vertically long (ex. 400x900) and the desired size is |
110 // square (ex. 100x100), the clipped bitmap will be the top half of the | 110 // square (ex. 100x100), the clipped bitmap will be the top half of the |
111 // input bitmap (400x400). | 111 // input bitmap (400x400). |
112 static SkBitmap GetClippedBitmap(const SkBitmap& bitmap, | 112 static SkBitmap GetClippedBitmap(const SkBitmap& bitmap, |
113 int desired_width, | 113 int desired_width, |
114 int desired_height, | 114 int desired_height, |
115 ClipResult* clip_result); | 115 ClipResult* clip_result); |
116 | 116 |
117 // Update the thumbnail of the given tab contents if necessary. | 117 // Update the thumbnail of the given tab contents if necessary. |
118 void UpdateThumbnailIfNecessary(TabContents* tab_contents); | 118 void UpdateThumbnailIfNecessary(content::WebContents* webb_contents); |
119 | 119 |
120 // Returns true if we should update the thumbnail of the given URL. | 120 // Returns true if we should update the thumbnail of the given URL. |
121 static bool ShouldUpdateThumbnail(Profile* profile, | 121 static bool ShouldUpdateThumbnail(Profile* profile, |
122 history::TopSites* top_sites, | 122 history::TopSites* top_sites, |
123 const GURL& url); | 123 const GURL& url); |
124 | 124 |
125 // content::WebContentsObserver overrides. | 125 // content::WebContentsObserver overrides. |
126 virtual void DidStartLoading() OVERRIDE; | 126 virtual void DidStartLoading() OVERRIDE; |
127 virtual void StopNavigation() OVERRIDE; | 127 virtual void StopNavigation() OVERRIDE; |
128 | 128 |
(...skipping 22 matching lines...) Expand all Loading... |
151 typedef std::map<int, | 151 typedef std::map<int, |
152 linked_ptr<AsyncRequestInfo> > ThumbnailCallbackMap; | 152 linked_ptr<AsyncRequestInfo> > ThumbnailCallbackMap; |
153 ThumbnailCallbackMap callback_map_; | 153 ThumbnailCallbackMap callback_map_; |
154 | 154 |
155 bool load_interrupted_; | 155 bool load_interrupted_; |
156 | 156 |
157 DISALLOW_COPY_AND_ASSIGN(ThumbnailGenerator); | 157 DISALLOW_COPY_AND_ASSIGN(ThumbnailGenerator); |
158 }; | 158 }; |
159 | 159 |
160 #endif // CHROME_BROWSER_TAB_CONTENTS_THUMBNAIL_GENERATOR_H_ | 160 #endif // CHROME_BROWSER_TAB_CONTENTS_THUMBNAIL_GENERATOR_H_ |
OLD | NEW |