| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 WebContents* BrowserTabRestoreServiceDelegate::GetActiveWebContents() const { | 44 WebContents* BrowserTabRestoreServiceDelegate::GetActiveWebContents() const { |
| 45 return browser_->tab_strip_model()->GetActiveWebContents(); | 45 return browser_->tab_strip_model()->GetActiveWebContents(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 bool BrowserTabRestoreServiceDelegate::IsTabPinned(int index) const { | 48 bool BrowserTabRestoreServiceDelegate::IsTabPinned(int index) const { |
| 49 return browser_->tab_strip_model()->IsTabPinned(index); | 49 return browser_->tab_strip_model()->IsTabPinned(index); |
| 50 } | 50 } |
| 51 | 51 |
| 52 WebContents* BrowserTabRestoreServiceDelegate::AddRestoredTab( | 52 WebContents* BrowserTabRestoreServiceDelegate::AddRestoredTab( |
| 53 const std::vector<TabNavigation>& navigations, | 53 const std::vector<components::SerializedNavigationEntry>& navigations, |
| 54 int tab_index, | 54 int tab_index, |
| 55 int selected_navigation, | 55 int selected_navigation, |
| 56 const std::string& extension_app_id, | 56 const std::string& extension_app_id, |
| 57 bool select, | 57 bool select, |
| 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 void BrowserTabRestoreServiceDelegate::ReplaceRestoredTab( |
| 69 const std::vector<TabNavigation>& navigations, | 69 const std::vector<components::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 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 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| OLD | NEW |