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

Side by Side Diff: content/public/browser/navigation_controller.h

Issue 15041004: Replace PruneAllButActive with PruneAllButVisible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update tests, mark TODOs Created 7 years, 7 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_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_
6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ 6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 // Broadcasts the NOTIFY_NAV_ENTRY_CHANGED notification for the given entry 379 // Broadcasts the NOTIFY_NAV_ENTRY_CHANGED notification for the given entry
380 // (which must be at the given index). This will keep things in sync like 380 // (which must be at the given index). This will keep things in sync like
381 // the saved session. 381 // the saved session.
382 virtual void NotifyEntryChanged(const NavigationEntry* entry, int index) = 0; 382 virtual void NotifyEntryChanged(const NavigationEntry* entry, int index) = 0;
383 383
384 // Copies the navigation state from the given controller to this one. This 384 // Copies the navigation state from the given controller to this one. This
385 // one should be empty (just created). 385 // one should be empty (just created).
386 virtual void CopyStateFrom(const NavigationController& source) = 0; 386 virtual void CopyStateFrom(const NavigationController& source) = 0;
387 387
388 // A variant of CopyStateFrom. Removes all entries from this except the last 388 // A variant of CopyStateFrom. Removes all entries from this except the last
389 // entry, inserts all entries from |source| before and including the active 389 // entry, and inserts all entries from |source| before and including its last
390 // entry. This method is intended for use when the last entry of |this| is the 390 // committed entry. This method is intended for use when the last entry of
391 // active entry. For example: 391 // |this| is the active entry. For example:
392 // source: A B *C* D 392 // source: A B *C* D
393 // this: E F *G* (last must be active or pending) 393 // this: E F *G* (last must be committed)
394 // result: A B C *G* 394 // result: A B C *G*
395 // This ignores the transient index of the source and honors that of 'this'. 395 // If there is a pending entry after *G* in |this|, it is also preserved.
396 virtual void CopyStateFromAndPrune(NavigationController* source) = 0; 396 // This ignores any pending or transient entries in |source|, and it returns
397 // false if it is unsafe to call (see CanPruneAllButVisible).
398 virtual bool CopyStateFromAndPrune(NavigationController* source) = 0;
397 399
398 // Removes all the entries except the active entry. If there is a new pending 400 // Returns whether it is safe to call PruneAllButVisible or
399 // navigation it is preserved. 401 // CopyStateFromAndPrune. There must be a last committed entry, no transient
400 virtual void PruneAllButActive() = 0; 402 // entry, and if there is a pending entry, it must be new and not an existing
403 // entry.
404 virtual bool CanPruneAllButVisible() = 0;
405
406 // Removes all the entries except the last committed entry. If there is a new
407 // pending navigation it is preserved. Returns false if it is unsafe to call
408 // (see CanPruneAllButVisible).
409 virtual bool PruneAllButVisible() = 0;
401 410
402 // Clears all screenshots associated with navigation entries in this 411 // Clears all screenshots associated with navigation entries in this
403 // controller. Useful to reduce memory consumption in low-memory situations. 412 // controller. Useful to reduce memory consumption in low-memory situations.
404 virtual void ClearAllScreenshots() = 0; 413 virtual void ClearAllScreenshots() = 0;
405 414
406 private: 415 private:
407 // This interface should only be implemented inside content. 416 // This interface should only be implemented inside content.
408 friend class NavigationControllerImpl; 417 friend class NavigationControllerImpl;
409 NavigationController() {} 418 NavigationController() {}
410 }; 419 };
411 420
412 } // namespace content 421 } // namespace content
413 422
414 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_ 423 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698