This source file includes following definitions.
- GetUndoManager
#include "chrome/browser/undo/bookmark_undo_utils.h"
#include "chrome/browser/undo/bookmark_undo_service.h"
#include "chrome/browser/undo/bookmark_undo_service_factory.h"
#include "chrome/browser/undo/undo_manager.h"
namespace {
UndoManager* GetUndoManager(Profile* profile) {
BookmarkUndoService* undo_service = profile ?
BookmarkUndoServiceFactory::GetForProfile(profile) : NULL;
return undo_service ? undo_service->undo_manager() : NULL;
}
}
ScopedSuspendBookmarkUndo::ScopedSuspendBookmarkUndo(Profile* profile)
: profile_(profile) {
UndoManager* undo_manager = GetUndoManager(profile_);
if (undo_manager)
undo_manager->SuspendUndoTracking();
}
ScopedSuspendBookmarkUndo::~ScopedSuspendBookmarkUndo() {
UndoManager *undo_manager = GetUndoManager(profile_);
if (undo_manager)
undo_manager->ResumeUndoTracking();
}