| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/extensions/api/sessions/sessions_api.h" | 5 #include "chrome/browser/extensions/api/sessions/sessions_api.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 return true; | 222 return true; |
| 223 } | 223 } |
| 224 | 224 |
| 225 scoped_ptr<tabs::Tab> SessionsGetDevicesFunction::CreateTabModel( | 225 scoped_ptr<tabs::Tab> SessionsGetDevicesFunction::CreateTabModel( |
| 226 const std::string& session_tag, | 226 const std::string& session_tag, |
| 227 const SessionTab& tab, | 227 const SessionTab& tab, |
| 228 int tab_index, | 228 int tab_index, |
| 229 int selected_index) { | 229 int selected_index) { |
| 230 std::string session_id = SessionId(session_tag, tab.tab_id.id()).ToString(); | 230 std::string session_id = SessionId(session_tag, tab.tab_id.id()).ToString(); |
| 231 return CreateTabModelHelper(GetProfile(), | 231 return CreateTabModelHelper(GetProfile(), |
| 232 tab.navigations[tab.current_navigation_index], | 232 tab.navigations[ |
| 233 tab.normalized_navigation_index()], |
| 233 session_id, | 234 session_id, |
| 234 tab_index, | 235 tab_index, |
| 235 tab.pinned, | 236 tab.pinned, |
| 236 selected_index, | 237 selected_index, |
| 237 GetExtension()); | 238 GetExtension()); |
| 238 } | 239 } |
| 239 | 240 |
| 240 scoped_ptr<windows::Window> SessionsGetDevicesFunction::CreateWindowModel( | 241 scoped_ptr<windows::Window> SessionsGetDevicesFunction::CreateWindowModel( |
| 241 const SessionWindow& window, const std::string& session_tag) { | 242 const SessionWindow& window, const std::string& session_tag) { |
| 242 DCHECK(!window.tabs.empty()); | 243 DCHECK(!window.tabs.empty()); |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 SetInvalidIdError(*params->session_id); | 571 SetInvalidIdError(*params->session_id); |
| 571 return false; | 572 return false; |
| 572 } | 573 } |
| 573 | 574 |
| 574 return session_id->IsForeign() ? | 575 return session_id->IsForeign() ? |
| 575 RestoreForeignSession(*session_id, browser) | 576 RestoreForeignSession(*session_id, browser) |
| 576 : RestoreLocalSession(*session_id, browser); | 577 : RestoreLocalSession(*session_id, browser); |
| 577 } | 578 } |
| 578 | 579 |
| 579 } // namespace extensions | 580 } // namespace extensions |
| OLD | NEW |