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

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

Issue 10850010: Make session restore understand that tabs have multiple SessionStorageNamespaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: attempt to fix unittsets. Created 8 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"
11 #include "chrome/browser/ui/browser_tabstrip.h" 11 #include "chrome/browser/ui/browser_tabstrip.h"
12 #include "chrome/browser/ui/browser_window.h" 12 #include "chrome/browser/ui/browser_window.h"
13 #include "chrome/browser/ui/tabs/tab_strip_model.h" 13 #include "chrome/browser/ui/tabs/tab_strip_model.h"
14 #include "content/public/browser/navigation_controller.h" 14 #include "content/public/browser/navigation_controller.h"
15 15
16 using content::NavigationController; 16 using content::NavigationController;
17 using content::SessionStorageNamespace; 17 using content::SessionStorageNamespaceMap;
18 using content::WebContents; 18 using content::WebContents;
19 19
20 void BrowserTabRestoreServiceDelegate::ShowBrowserWindow() { 20 void BrowserTabRestoreServiceDelegate::ShowBrowserWindow() {
21 browser_->window()->Show(); 21 browser_->window()->Show();
22 } 22 }
23 23
24 const SessionID& BrowserTabRestoreServiceDelegate::GetSessionID() const { 24 const SessionID& BrowserTabRestoreServiceDelegate::GetSessionID() const {
25 return browser_->session_id(); 25 return browser_->session_id();
26 } 26 }
27 27
(...skipping 23 matching lines...) Expand all
51 } 51 }
52 52
53 WebContents* BrowserTabRestoreServiceDelegate::AddRestoredTab( 53 WebContents* BrowserTabRestoreServiceDelegate::AddRestoredTab(
54 const std::vector<TabNavigation>& navigations, 54 const std::vector<TabNavigation>& navigations,
55 int tab_index, 55 int tab_index,
56 int selected_navigation, 56 int selected_navigation,
57 const std::string& extension_app_id, 57 const std::string& extension_app_id,
58 bool select, 58 bool select,
59 bool pin, 59 bool pin,
60 bool from_last_session, 60 bool from_last_session,
61 SessionStorageNamespace* storage_namespace, 61 const SessionStorageNamespaceMap& storage_namespace_map,
62 const std::string& user_agent_override) { 62 const std::string& user_agent_override) {
63 return chrome::AddRestoredTab(browser_, navigations, tab_index, 63 return chrome::AddRestoredTab(browser_, navigations, tab_index,
64 selected_navigation, extension_app_id, select, 64 selected_navigation, extension_app_id, select,
65 pin, from_last_session, storage_namespace, 65 pin, from_last_session, storage_namespace_map,
66 user_agent_override); 66 user_agent_override);
67 } 67 }
68 68
69 void BrowserTabRestoreServiceDelegate::ReplaceRestoredTab( 69 void BrowserTabRestoreServiceDelegate::ReplaceRestoredTab(
70 const std::vector<TabNavigation>& navigations, 70 const std::vector<TabNavigation>& navigations,
71 int selected_navigation, 71 int selected_navigation,
72 bool from_last_session, 72 bool from_last_session,
73 const std::string& extension_app_id, 73 const std::string& extension_app_id,
74 SessionStorageNamespace* session_storage_namespace, 74 const SessionStorageNamespaceMap& storage_namespace_map,
75 const std::string& user_agent_override) { 75 const std::string& user_agent_override) {
76 chrome::ReplaceRestoredTab(browser_, navigations, selected_navigation, 76 chrome::ReplaceRestoredTab(browser_, navigations, selected_navigation,
77 from_last_session, extension_app_id, 77 from_last_session, extension_app_id,
78 session_storage_namespace, user_agent_override); 78 storage_namespace_map, user_agent_override);
79 } 79 }
80 80
81 void BrowserTabRestoreServiceDelegate::CloseTab() { 81 void BrowserTabRestoreServiceDelegate::CloseTab() {
82 chrome::CloseTab(browser_); 82 chrome::CloseTab(browser_);
83 } 83 }
84 84
85 // Implementations of TabRestoreServiceDelegate static methods 85 // Implementations of TabRestoreServiceDelegate static methods
86 86
87 // static 87 // static
88 TabRestoreServiceDelegate* TabRestoreServiceDelegate::Create( 88 TabRestoreServiceDelegate* TabRestoreServiceDelegate::Create(
(...skipping 20 matching lines...) Expand all
109 Browser* browser = browser::FindBrowserWithWebContents(contents); 109 Browser* browser = browser::FindBrowserWithWebContents(contents);
110 return browser ? browser->tab_restore_service_delegate() : NULL; 110 return browser ? browser->tab_restore_service_delegate() : NULL;
111 } 111 }
112 112
113 // static 113 // static
114 TabRestoreServiceDelegate* TabRestoreServiceDelegate::FindDelegateWithID( 114 TabRestoreServiceDelegate* TabRestoreServiceDelegate::FindDelegateWithID(
115 SessionID::id_type desired_id) { 115 SessionID::id_type desired_id) {
116 Browser* browser = browser::FindBrowserWithID(desired_id); 116 Browser* browser = browser::FindBrowserWithID(desired_id);
117 return browser ? browser->tab_restore_service_delegate() : NULL; 117 return browser ? browser->tab_restore_service_delegate() : NULL;
118 } 118 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_tab_restore_service_delegate.h ('k') | chrome/browser/ui/browser_tabrestore.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698