| 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 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 content::RenderWidgetHost* widget, | 137 content::RenderWidgetHost* widget, |
| 138 int tag, | 138 int tag, |
| 139 const gfx::Size& size); | 139 const gfx::Size& size); |
| 140 | 140 |
| 141 // Asynchronously updates the thumbnail of the given tab. This must be called | 141 // Asynchronously updates the thumbnail of the given tab. This must be called |
| 142 // on the UI thread. | 142 // on the UI thread. |
| 143 void AsyncUpdateThumbnail(content::WebContents* web_contents); | 143 void AsyncUpdateThumbnail(content::WebContents* web_contents); |
| 144 | 144 |
| 145 // Called when the bitmap for generating a thumbnail is ready after the | 145 // Called when the bitmap for generating a thumbnail is ready after the |
| 146 // AsyncUpdateThumbnail invocation. This runs on the UI thread. | 146 // AsyncUpdateThumbnail invocation. This runs on the UI thread. |
| 147 void AsyncUpdateThumbnailFinish( | 147 void UpdateThumbnailWithBitmap( |
| 148 base::WeakPtr<content::WebContents> web_contents, | 148 const base::WeakPtr<content::WebContents>& web_contents, |
| 149 const SkBitmap& bitmap); |
| 150 |
| 151 // Called when the canvas for generating a thumbnail is ready after the |
| 152 // AsyncUpdateThumbnail invocation. This runs on the UI thread. |
| 153 void UpdateThumbnailWithCanvas( |
| 154 const base::WeakPtr<content::WebContents>& web_contents, |
| 149 skia::PlatformCanvas* temp_canvas, | 155 skia::PlatformCanvas* temp_canvas, |
| 150 bool result); | 156 bool result); |
| 151 | 157 |
| 152 // content::NotificationObserver interface. | 158 // content::NotificationObserver interface. |
| 153 virtual void Observe(int type, | 159 virtual void Observe(int type, |
| 154 const content::NotificationSource& source, | 160 const content::NotificationSource& source, |
| 155 const content::NotificationDetails& details) OVERRIDE; | 161 const content::NotificationDetails& details) OVERRIDE; |
| 156 | 162 |
| 157 // Indicates that the given widget has changed is visibility. | 163 // Indicates that the given widget has changed is visibility. |
| 158 void WidgetHidden(content::RenderWidgetHost* widget); | 164 void WidgetHidden(content::RenderWidgetHost* widget); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 173 bool load_interrupted_; | 179 bool load_interrupted_; |
| 174 | 180 |
| 175 base::WeakPtrFactory<ThumbnailGenerator> weak_factory_; | 181 base::WeakPtrFactory<ThumbnailGenerator> weak_factory_; |
| 176 scoped_ptr<base::WeakPtrFactory<content::WebContents> > | 182 scoped_ptr<base::WeakPtrFactory<content::WebContents> > |
| 177 web_contents_weak_factory_; | 183 web_contents_weak_factory_; |
| 178 | 184 |
| 179 DISALLOW_COPY_AND_ASSIGN(ThumbnailGenerator); | 185 DISALLOW_COPY_AND_ASSIGN(ThumbnailGenerator); |
| 180 }; | 186 }; |
| 181 | 187 |
| 182 #endif // CHROME_BROWSER_TAB_CONTENTS_THUMBNAIL_GENERATOR_H_ | 188 #endif // CHROME_BROWSER_TAB_CONTENTS_THUMBNAIL_GENERATOR_H_ |
| OLD | NEW |