Chromium Code Reviews| Index: chrome/browser/thumbnails/thumbnailing_context.cc |
| diff --git a/chrome/browser/thumbnails/thumbnailing_context.cc b/chrome/browser/thumbnails/thumbnailing_context.cc |
| index 04765e640550aaadb791ecf188739fa49b4c98ad..d1cd2bf6c845fb63a8629e9164aef2779643ebc7 100644 |
| --- a/chrome/browser/thumbnails/thumbnailing_context.cc |
| +++ b/chrome/browser/thumbnails/thumbnailing_context.cc |
| @@ -12,19 +12,56 @@ namespace thumbnails { |
| ThumbnailingContext::ThumbnailingContext(content::WebContents* web_contents, |
| ThumbnailService* receiving_service, |
| bool load_interrupted) |
| - : service(receiving_service), |
| - url(web_contents->GetURL()), |
| - clip_result(CLIP_RESULT_UNPROCESSED) { |
| - score.at_top = |
| + : content::WebContentsObserver(web_contents), |
| + service_(receiving_service), |
| + clip_result_(CLIP_RESULT_UNPROCESSED) { |
| + score_.at_top = |
| (web_contents->GetRenderWidgetHostView()->GetLastScrollOffset().y() == 0); |
| - score.load_completed = !web_contents->IsLoading() && !load_interrupted; |
| + score_.load_completed = !web_contents->IsLoading() && !load_interrupted; |
| } |
| ThumbnailingContext::ThumbnailingContext() |
| - : clip_result(CLIP_RESULT_UNPROCESSED) { |
| + : clip_result_(CLIP_RESULT_UNPROCESSED) { |
| } |
| ThumbnailingContext::~ThumbnailingContext() { |
| } |
| +const scoped_refptr<ThumbnailService>& ThumbnailingContext::service() const { |
| + return service_; |
| +} |
| + |
| +const GURL& ThumbnailingContext::GetURL() const { |
| + return web_contents()->GetURL(); |
| +} |
| + |
| +ClipResult ThumbnailingContext::clip_result() const { |
| + return clip_result_; |
| +} |
| + |
| +void ThumbnailingContext::set_clip_result(ClipResult result) { |
| + clip_result_ = result; |
| +} |
| + |
| +gfx::Size ThumbnailingContext::requested_copy_size() { |
| + return requested_copy_size_; |
| +} |
| + |
| +void ThumbnailingContext::set_requested_copy_size(const gfx::Size& |
| + requested_size) { |
|
Lei Zhang
2015/11/03 18:59:25
nit: not a good spot for a line break.
void Thumb
shrike
2015/11/03 19:10:49
Acknowledged.
|
| + requested_copy_size_ = requested_size; |
| +} |
| + |
| +ThumbnailScore ThumbnailingContext::score() const { |
| + return score_; |
| +} |
| + |
| +void ThumbnailingContext::SetBoringScore(double score) { |
| + score_.boring_score = score; |
| +} |
| + |
| +void ThumbnailingContext::SetGoodClipping(bool is_good_clipping) { |
| + score_.good_clipping = is_good_clipping; |
| +} |
| + |
| } // namespace thumbnails |