OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "chrome/browser/thumbnails/thumbnailing_context.h" | 5 #include "chrome/browser/thumbnails/thumbnailing_context.h" |
6 | 6 |
7 #include "content/public/browser/render_view_host.h" | 7 #include "content/public/browser/render_view_host.h" |
8 #include "content/public/browser/render_widget_host_view.h" | 8 #include "content/public/browser/render_widget_host_view.h" |
9 | 9 |
10 namespace thumbnails { | 10 namespace thumbnails { |
11 | 11 |
12 ThumbnailingContext::ThumbnailingContext(content::WebContents* web_contents, | 12 ThumbnailingContext::ThumbnailingContext(content::WebContents* web_contents, |
13 ThumbnailService* receiving_service, | 13 ThumbnailService* receiving_service, |
14 bool load_interrupted) | 14 bool load_interrupted) |
15 : service(receiving_service), | 15 : service(receiving_service), |
| 16 web_contents(web_contents), |
16 url(web_contents->GetURL()), | 17 url(web_contents->GetURL()), |
17 clip_result(CLIP_RESULT_UNPROCESSED) { | 18 clip_result(CLIP_RESULT_UNPROCESSED) { |
18 score.at_top = | 19 score.at_top = |
19 (web_contents->GetRenderWidgetHostView()->GetLastScrollOffset().y() == 0); | 20 (web_contents->GetRenderWidgetHostView()->GetLastScrollOffset().y() == 0); |
20 score.load_completed = !web_contents->IsLoading() && !load_interrupted; | 21 score.load_completed = !web_contents->IsLoading() && !load_interrupted; |
21 } | 22 } |
22 | 23 |
23 ThumbnailingContext::ThumbnailingContext() | 24 ThumbnailingContext::ThumbnailingContext() |
24 : clip_result(CLIP_RESULT_UNPROCESSED) { | 25 : clip_result(CLIP_RESULT_UNPROCESSED) { |
25 } | 26 } |
26 | 27 |
27 ThumbnailingContext::~ThumbnailingContext() { | 28 ThumbnailingContext::~ThumbnailingContext() { |
28 } | 29 } |
29 | 30 |
30 } // namespace thumbnails | 31 } // namespace thumbnails |
OLD | NEW |