| 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" |
| 11 #include "chrome/browser/ui/browser_window.h" | 11 #include "chrome/browser/ui/browser_window.h" |
| 12 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 12 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 13 #include "content/public/browser/navigation_controller.h" | 13 #include "content/public/browser/navigation_controller.h" |
| 14 | 14 |
| 15 using content::NavigationController; | 15 using content::NavigationController; |
| 16 using content::SessionStorageNamespace; | 16 using content::SessionStorageNamespace; |
| 17 using content::WebContents; | 17 using content::WebContents; |
| 18 | 18 |
| 19 void BrowserTabRestoreServiceDelegate::ShowBrowserWindow() { | 19 void BrowserTabRestoreServiceDelegate::ShowBrowserWindow() { |
| 20 browser_->window()->Show(); | 20 // TODO(johnme): Can we sometimes be certain this was for a user gesture? |
| 21 browser_->window()->Show(false /* user_gesture */); |
| 21 } | 22 } |
| 22 | 23 |
| 23 const SessionID& BrowserTabRestoreServiceDelegate::GetSessionID() const { | 24 const SessionID& BrowserTabRestoreServiceDelegate::GetSessionID() const { |
| 24 return browser_->session_id(); | 25 return browser_->session_id(); |
| 25 } | 26 } |
| 26 | 27 |
| 27 int BrowserTabRestoreServiceDelegate::GetTabCount() const { | 28 int BrowserTabRestoreServiceDelegate::GetTabCount() const { |
| 28 return browser_->tab_strip_model()->count(); | 29 return browser_->tab_strip_model()->count(); |
| 29 } | 30 } |
| 30 | 31 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 } | 114 } |
| 114 | 115 |
| 115 // static | 116 // static |
| 116 TabRestoreServiceDelegate* TabRestoreServiceDelegate::FindDelegateWithID( | 117 TabRestoreServiceDelegate* TabRestoreServiceDelegate::FindDelegateWithID( |
| 117 SessionID::id_type desired_id, | 118 SessionID::id_type desired_id, |
| 118 chrome::HostDesktopType host_desktop_type) { | 119 chrome::HostDesktopType host_desktop_type) { |
| 119 Browser* browser = chrome::FindBrowserWithID(desired_id); | 120 Browser* browser = chrome::FindBrowserWithID(desired_id); |
| 120 return (browser && browser->host_desktop_type() == host_desktop_type) ? | 121 return (browser && browser->host_desktop_type() == host_desktop_type) ? |
| 121 browser->tab_restore_service_delegate() : NULL; | 122 browser->tab_restore_service_delegate() : NULL; |
| 122 } | 123 } |
| OLD | NEW |