| OLD | NEW |
| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 SessionStorageNamespace* storage_namespace, |
| 62 const std::string& user_agent_override) { |
| 62 return chrome::AddRestoredTab(browser_, navigations, tab_index, | 63 return chrome::AddRestoredTab(browser_, navigations, tab_index, |
| 63 selected_navigation, extension_app_id, select, | 64 selected_navigation, extension_app_id, select, |
| 64 pin, from_last_session, storage_namespace); | 65 pin, from_last_session, storage_namespace, |
| 66 user_agent_override); |
| 65 } | 67 } |
| 66 | 68 |
| 67 void BrowserTabRestoreServiceDelegate::ReplaceRestoredTab( | 69 void BrowserTabRestoreServiceDelegate::ReplaceRestoredTab( |
| 68 const std::vector<TabNavigation>& navigations, | 70 const std::vector<TabNavigation>& navigations, |
| 69 int selected_navigation, | 71 int selected_navigation, |
| 70 bool from_last_session, | 72 bool from_last_session, |
| 71 const std::string& extension_app_id, | 73 const std::string& extension_app_id, |
| 72 SessionStorageNamespace* session_storage_namespace) { | 74 SessionStorageNamespace* session_storage_namespace, |
| 75 const std::string& user_agent_override) { |
| 73 chrome::ReplaceRestoredTab(browser_, navigations, selected_navigation, | 76 chrome::ReplaceRestoredTab(browser_, navigations, selected_navigation, |
| 74 from_last_session, extension_app_id, | 77 from_last_session, extension_app_id, |
| 75 session_storage_namespace); | 78 session_storage_namespace, user_agent_override); |
| 76 } | 79 } |
| 77 | 80 |
| 78 void BrowserTabRestoreServiceDelegate::CloseTab() { | 81 void BrowserTabRestoreServiceDelegate::CloseTab() { |
| 79 chrome::CloseTab(browser_); | 82 chrome::CloseTab(browser_); |
| 80 } | 83 } |
| 81 | 84 |
| 82 // Implementations of TabRestoreServiceDelegate static methods | 85 // Implementations of TabRestoreServiceDelegate static methods |
| 83 | 86 |
| 84 // static | 87 // static |
| 85 TabRestoreServiceDelegate* TabRestoreServiceDelegate::Create( | 88 TabRestoreServiceDelegate* TabRestoreServiceDelegate::Create( |
| (...skipping 20 matching lines...) Expand all Loading... |
| 106 Browser* browser = browser::FindBrowserWithWebContents(contents); | 109 Browser* browser = browser::FindBrowserWithWebContents(contents); |
| 107 return browser ? browser->tab_restore_service_delegate() : NULL; | 110 return browser ? browser->tab_restore_service_delegate() : NULL; |
| 108 } | 111 } |
| 109 | 112 |
| 110 // static | 113 // static |
| 111 TabRestoreServiceDelegate* TabRestoreServiceDelegate::FindDelegateWithID( | 114 TabRestoreServiceDelegate* TabRestoreServiceDelegate::FindDelegateWithID( |
| 112 SessionID::id_type desired_id) { | 115 SessionID::id_type desired_id) { |
| 113 Browser* browser = browser::FindBrowserWithID(desired_id); | 116 Browser* browser = browser::FindBrowserWithID(desired_id); |
| 114 return browser ? browser->tab_restore_service_delegate() : NULL; | 117 return browser ? browser->tab_restore_service_delegate() : NULL; |
| 115 } | 118 } |
| OLD | NEW |