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

Side by Side Diff: chrome/browser/ui/browser_tab_restore_service_delegate.cc

Issue 21022018: Sessions API - previously Session Restore API. Supports restoring currently open foreign windows an… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added assert true to test Created 7 years, 4 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 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" 5 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h"
6 6
7 #include "chrome/browser/ui/browser.h" 7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/browser_commands.h" 8 #include "chrome/browser/ui/browser_commands.h"
9 #include "chrome/browser/ui/browser_finder.h" 9 #include "chrome/browser/ui/browser_finder.h"
10 #include "chrome/browser/ui/browser_tabrestore.h" 10 #include "chrome/browser/ui/browser_tabrestore.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 bool pin, 58 bool pin,
59 bool from_last_session, 59 bool from_last_session,
60 SessionStorageNamespace* storage_namespace, 60 SessionStorageNamespace* storage_namespace,
61 const std::string& user_agent_override) { 61 const std::string& user_agent_override) {
62 return chrome::AddRestoredTab(browser_, navigations, tab_index, 62 return chrome::AddRestoredTab(browser_, navigations, tab_index,
63 selected_navigation, extension_app_id, select, 63 selected_navigation, extension_app_id, select,
64 pin, from_last_session, storage_namespace, 64 pin, from_last_session, storage_namespace,
65 user_agent_override); 65 user_agent_override);
66 } 66 }
67 67
68 void BrowserTabRestoreServiceDelegate::ReplaceRestoredTab( 68 WebContents* BrowserTabRestoreServiceDelegate::ReplaceRestoredTab(
69 const std::vector<sessions::SerializedNavigationEntry>& navigations, 69 const std::vector<sessions::SerializedNavigationEntry>& navigations,
70 int selected_navigation, 70 int selected_navigation,
71 bool from_last_session, 71 bool from_last_session,
72 const std::string& extension_app_id, 72 const std::string& extension_app_id,
73 SessionStorageNamespace* session_storage_namespace, 73 SessionStorageNamespace* session_storage_namespace,
74 const std::string& user_agent_override) { 74 const std::string& user_agent_override) {
75 chrome::ReplaceRestoredTab(browser_, navigations, selected_navigation, 75 return chrome::ReplaceRestoredTab(browser_, navigations, selected_navigation,
76 from_last_session, extension_app_id, 76 from_last_session, extension_app_id,
77 session_storage_namespace, user_agent_override); 77 session_storage_namespace, user_agent_override);
78 } 78 }
79 79
80 void BrowserTabRestoreServiceDelegate::CloseTab() { 80 void BrowserTabRestoreServiceDelegate::CloseTab() {
81 chrome::CloseTab(browser_); 81 chrome::CloseTab(browser_);
82 } 82 }
83 83
84 // Implementations of TabRestoreServiceDelegate static methods 84 // Implementations of TabRestoreServiceDelegate static methods
85 85
(...skipping 26 matching lines...) Expand all
112 } 112 }
113 113
114 // static 114 // static
115 TabRestoreServiceDelegate* TabRestoreServiceDelegate::FindDelegateWithID( 115 TabRestoreServiceDelegate* TabRestoreServiceDelegate::FindDelegateWithID(
116 SessionID::id_type desired_id, 116 SessionID::id_type desired_id,
117 chrome::HostDesktopType host_desktop_type) { 117 chrome::HostDesktopType host_desktop_type) {
118 Browser* browser = chrome::FindBrowserWithID(desired_id); 118 Browser* browser = chrome::FindBrowserWithID(desired_id);
119 return (browser && browser->host_desktop_type() == host_desktop_type) ? 119 return (browser && browser->host_desktop_type() == host_desktop_type) ?
120 browser->tab_restore_service_delegate() : NULL; 120 browser->tab_restore_service_delegate() : NULL;
121 } 121 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698