Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1145)

Unified Diff: chrome/browser/thumbnails/thumbnailing_context.cc

Issue 11985003: Refactored-out the code of thumbnaling algorithm from thumbnail_tab_helper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added a unit test. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/thumbnails/thumbnailing_context.cc
diff --git a/chrome/browser/thumbnails/thumbnailing_context.cc b/chrome/browser/thumbnails/thumbnailing_context.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ffbc07502611055a75a436cae03b9586e3eb6cc3
--- /dev/null
+++ b/chrome/browser/thumbnails/thumbnailing_context.cc
@@ -0,0 +1,25 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/thumbnails/thumbnailing_context.h"
+
+#include "content/public/browser/render_view_host.h"
+
+namespace thumbnails {
+
+ThumbnailingContext::ThumbnailingContext(
+ content::WebContents* web_contents,
+ bool load_interrupted)
+ : browser_context(web_contents->GetBrowserContext()),
+ url(web_contents->GetURL()),
+ clip_result(kUnprocessed) {
+ score.at_top =
+ (web_contents->GetRenderViewHost()->GetLastScrollOffset().y() == 0);
+ score.load_completed = !web_contents->IsLoading() && !load_interrupted;
+}
+
+ThumbnailingContext::~ThumbnailingContext() {
+}
+
+}

Powered by Google App Engine
This is Rietveld 408576698