Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / chrome / browser / sessions / in_memory_tab_restore_service.cc
blob46c3310462422f8c48a49d6fe75438b163e191fc
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
3 // found in the LICENSE file.
5 #include "chrome/browser/sessions/in_memory_tab_restore_service.h"
7 #include <vector>
9 #include "base/compiler_specific.h"
11 InMemoryTabRestoreService::InMemoryTabRestoreService(
12 Profile* profile,
13 scoped_ptr<sessions::TabRestoreServiceClient> client,
14 TabRestoreService::TimeFactory* time_factory)
15 : client_(client.Pass()),
16 helper_(this, NULL, profile, client_.get(), time_factory) {}
18 InMemoryTabRestoreService::~InMemoryTabRestoreService() {}
20 void InMemoryTabRestoreService::AddObserver(
21 TabRestoreServiceObserver* observer) {
22 helper_.AddObserver(observer);
25 void InMemoryTabRestoreService::RemoveObserver(
26 TabRestoreServiceObserver* observer) {
27 helper_.RemoveObserver(observer);
30 void InMemoryTabRestoreService::CreateHistoricalTab(
31 content::WebContents* contents,
32 int index) {
33 helper_.CreateHistoricalTab(contents, index);
36 void InMemoryTabRestoreService::BrowserClosing(
37 TabRestoreServiceDelegate* delegate) {
38 helper_.BrowserClosing(delegate);
41 void InMemoryTabRestoreService::BrowserClosed(
42 TabRestoreServiceDelegate* delegate) {
43 helper_.BrowserClosed(delegate);
46 void InMemoryTabRestoreService::ClearEntries() {
47 helper_.ClearEntries();
50 const TabRestoreService::Entries& InMemoryTabRestoreService::entries() const {
51 return helper_.entries();
54 std::vector<content::WebContents*>
55 InMemoryTabRestoreService::RestoreMostRecentEntry(
56 TabRestoreServiceDelegate* delegate,
57 chrome::HostDesktopType host_desktop_type) {
58 return helper_.RestoreMostRecentEntry(delegate, host_desktop_type);
61 TabRestoreService::Tab* InMemoryTabRestoreService::RemoveTabEntryById(
62 SessionID::id_type id) {
63 return helper_.RemoveTabEntryById(id);
66 std::vector<content::WebContents*> InMemoryTabRestoreService::RestoreEntryById(
67 TabRestoreServiceDelegate* delegate,
68 SessionID::id_type id,
69 chrome::HostDesktopType host_desktop_type,
70 WindowOpenDisposition disposition) {
71 return helper_.RestoreEntryById(delegate, id, host_desktop_type, disposition);
74 void InMemoryTabRestoreService::LoadTabsFromLastSession() {
75 // Do nothing. This relies on tab persistence which is implemented in Java on
76 // the application side on Android.
79 bool InMemoryTabRestoreService::IsLoaded() const {
80 // See comment above.
81 return true;
84 void InMemoryTabRestoreService::DeleteLastSession() {
85 // See comment above.
88 void InMemoryTabRestoreService::Shutdown() {