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

Side by Side Diff: content/browser/web_contents/navigation_controller_impl.h

Issue 11776010: overscroll: Take a screenshot at more appropriate times. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_CONTROLLER_IMPL_H_ 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_CONTROLLER_IMPL_H_
6 #define CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_CONTROLLER_IMPL_H_ 6 #define CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_CONTROLLER_IMPL_H_
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 192
193 // Maximum number of entries before we start removing entries from the front. 193 // Maximum number of entries before we start removing entries from the front.
194 static void set_max_entry_count_for_testing(size_t max_entry_count) { 194 static void set_max_entry_count_for_testing(size_t max_entry_count) {
195 max_entry_count_for_testing_ = max_entry_count; 195 max_entry_count_for_testing_ = max_entry_count;
196 } 196 }
197 static size_t max_entry_count(); 197 static size_t max_entry_count();
198 198
199 void SetGetTimestampCallbackForTest( 199 void SetGetTimestampCallbackForTest(
200 const base::Callback<base::Time()>& get_timestamp_callback); 200 const base::Callback<base::Time()>& get_timestamp_callback);
201 201
202 // Takes a screenshot of the page at the current state.
203 void TakeScreenshot();
204
202 private: 205 private:
203 friend class RestoreHelper; 206 friend class RestoreHelper;
204 friend class WebContentsImpl; // For invoking OnReservedPageIDRange. 207 friend class WebContentsImpl; // For invoking OnReservedPageIDRange.
205 208
206 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, Basic); 209 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, Basic);
207 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, SingleDuplicate); 210 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, SingleDuplicate);
208 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, ManyDuplicates); 211 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, ManyDuplicates);
209 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, ClockBackwardsJump); 212 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, ClockBackwardsJump);
210 213
211 // Helper class to smooth out runs of duplicate timestamps while still 214 // Helper class to smooth out runs of duplicate timestamps while still
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 // Inserts up to |max_index| entries from |source| into this. This does NOT 308 // Inserts up to |max_index| entries from |source| into this. This does NOT
306 // adjust any of the members that reference entries_ 309 // adjust any of the members that reference entries_
307 // (last_committed_entry_index_, pending_entry_index_ or 310 // (last_committed_entry_index_, pending_entry_index_ or
308 // transient_entry_index_). 311 // transient_entry_index_).
309 void InsertEntriesFrom(const NavigationControllerImpl& source, int max_index); 312 void InsertEntriesFrom(const NavigationControllerImpl& source, int max_index);
310 313
311 // Returns the navigation index that differs from the current entry by the 314 // Returns the navigation index that differs from the current entry by the
312 // specified |offset|. The index returned is not guaranteed to be valid. 315 // specified |offset|. The index returned is not guaranteed to be valid.
313 int GetIndexForOffset(int offset) const; 316 int GetIndexForOffset(int offset) const;
314 317
315 // Takes a screenshot of the page at the current state.
316 void TakeScreenshot();
317
318 // The callback invoked when taking the screenshot of the page is complete. 318 // The callback invoked when taking the screenshot of the page is complete.
319 // This sets the screenshot on the navigation entry. 319 // This sets the screenshot on the navigation entry.
320 void OnScreenshotTaken(int unique_id, 320 void OnScreenshotTaken(int unique_id,
321 skia::PlatformBitmap* bitmap, 321 skia::PlatformBitmap* bitmap,
322 bool success); 322 bool success);
323 323
324 // --------------------------------------------------------------------------- 324 // ---------------------------------------------------------------------------
325 325
326 // The user browser context associated with this controller. 326 // The user browser context associated with this controller.
327 BrowserContext* browser_context_; 327 BrowserContext* browser_context_;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 // the timer resolution, leading to things sometimes showing up in 397 // the timer resolution, leading to things sometimes showing up in
398 // the wrong order in the history view. 398 // the wrong order in the history view.
399 TimeSmoother time_smoother_; 399 TimeSmoother time_smoother_;
400 400
401 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl); 401 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl);
402 }; 402 };
403 403
404 } // namespace content 404 } // namespace content
405 405
406 #endif // CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_CONTROLLER_IMPL_H_ 406 #endif // CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_CONTROLLER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698