| 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..3f8820031b85b413b84bd8f8f893e61a969eec71 100644
|
| --- a/chrome/browser/thumbnails/thumbnailing_context.cc
|
| +++ b/chrome/browser/thumbnails/thumbnailing_context.cc
|
| @@ -9,22 +9,66 @@
|
|
|
| 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 =
|
| +ThumbnailingContext::ThumbnailingContext(
|
| + content::WebContents* web_contents,
|
| + ThumbnailService* receiving_service,
|
| + base::WeakPtr<ThumbnailTabHelper> source_tab_helper,
|
| + bool load_interrupted)
|
| + : content::WebContentsObserver(web_contents),
|
| + service_(receiving_service),
|
| + clip_result_(CLIP_RESULT_UNPROCESSED),
|
| + source_tab_helper_(source_tab_helper) {
|
| +
|
| + 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) {
|
| + : content::WebContentsObserver(nullptr),
|
| + service_(nullptr),
|
| + clip_result_(CLIP_RESULT_UNPROCESSED),
|
| + source_tab_helper_(base::WeakPtr<ThumbnailTabHelper>()) {
|
| }
|
|
|
| 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) {
|
| + 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
|
|
|