| 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 #ifndef CHROME_BROWSER_UI_BROWSER_TAB_RESTORE_SERVICE_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_TAB_RESTORE_SERVICE_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_UI_BROWSER_TAB_RESTORE_SERVICE_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_TAB_RESTORE_SERVICE_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "chrome/browser/sessions/tab_restore_service_delegate.h" | 12 #include "chrome/browser/sessions/tab_restore_service_delegate.h" |
| 13 #include "chrome/browser/ui/host_desktop.h" |
| 13 | 14 |
| 14 class Browser; | 15 class Browser; |
| 16 class Profile; |
| 15 | 17 |
| 16 // Implementation of TabRestoreServiceDelegate which uses an instance of | 18 // Implementation of TabRestoreServiceDelegate which uses an instance of |
| 17 // Browser in order to fulfil its duties. | 19 // Browser in order to fulfil its duties. |
| 18 class BrowserTabRestoreServiceDelegate : public TabRestoreServiceDelegate { | 20 class BrowserTabRestoreServiceDelegate : public TabRestoreServiceDelegate { |
| 19 public: | 21 public: |
| 20 explicit BrowserTabRestoreServiceDelegate(Browser* browser) | 22 explicit BrowserTabRestoreServiceDelegate(Browser* browser) |
| 21 : browser_(browser) {} | 23 : browser_(browser) {} |
| 22 ~BrowserTabRestoreServiceDelegate() override {} | 24 ~BrowserTabRestoreServiceDelegate() override {} |
| 23 | 25 |
| 24 // Overridden from TabRestoreServiceDelegate: | 26 // Overridden from TabRestoreServiceDelegate: |
| (...skipping 17 matching lines...) Expand all Loading... |
| 42 const std::string& user_agent_override) override; | 44 const std::string& user_agent_override) override; |
| 43 content::WebContents* ReplaceRestoredTab( | 45 content::WebContents* ReplaceRestoredTab( |
| 44 const std::vector<sessions::SerializedNavigationEntry>& navigations, | 46 const std::vector<sessions::SerializedNavigationEntry>& navigations, |
| 45 int selected_navigation, | 47 int selected_navigation, |
| 46 bool from_last_session, | 48 bool from_last_session, |
| 47 const std::string& extension_app_id, | 49 const std::string& extension_app_id, |
| 48 content::SessionStorageNamespace* session_storage_namespace, | 50 content::SessionStorageNamespace* session_storage_namespace, |
| 49 const std::string& user_agent_override) override; | 51 const std::string& user_agent_override) override; |
| 50 void CloseTab() override; | 52 void CloseTab() override; |
| 51 | 53 |
| 54 // see Browser::Create |
| 55 static TabRestoreServiceDelegate* Create( |
| 56 Profile* profile, |
| 57 chrome::HostDesktopType host_desktop_type, |
| 58 const std::string& app_name); |
| 59 |
| 60 // see browser::FindBrowserForWebContents |
| 61 static TabRestoreServiceDelegate* FindDelegateForWebContents( |
| 62 const content::WebContents* contents); |
| 63 |
| 64 // see chrome::FindBrowserWithID |
| 65 // Returns the TabRestoreServiceDelegate of the Browser with |desired_id| if |
| 66 // such a Browser exists and is on the desktop defined by |host_desktop_type|. |
| 67 static TabRestoreServiceDelegate* FindDelegateWithID( |
| 68 SessionID::id_type desired_id, |
| 69 chrome::HostDesktopType host_desktop_type); |
| 70 |
| 52 private: | 71 private: |
| 53 Browser* browser_; | 72 Browser* browser_; |
| 54 | 73 |
| 55 DISALLOW_COPY_AND_ASSIGN(BrowserTabRestoreServiceDelegate); | 74 DISALLOW_COPY_AND_ASSIGN(BrowserTabRestoreServiceDelegate); |
| 56 }; | 75 }; |
| 57 | 76 |
| 58 #endif // CHROME_BROWSER_UI_BROWSER_TAB_RESTORE_SERVICE_DELEGATE_H_ | 77 #endif // CHROME_BROWSER_UI_BROWSER_TAB_RESTORE_SERVICE_DELEGATE_H_ |
| OLD | NEW |