| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/sessions/ios/ios_live_tab.h" | 5 #include "components/sessions/ios/ios_live_tab.h" |
| 6 #include "ios/web/public/navigation_manager.h" | 6 #include "ios/web/public/navigation_manager.h" |
| 7 | 7 |
| 8 namespace { | 8 namespace { |
| 9 const char kIOSLiveTabWebStateUserDataKey[] = "ios_live_tab"; | 9 const char kIOSLiveTabWebStateUserDataKey[] = "ios_live_tab"; |
| 10 } | 10 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 } | 21 } |
| 22 | 22 |
| 23 return static_cast<IOSLiveTab*>( | 23 return static_cast<IOSLiveTab*>( |
| 24 web_state->GetUserData(kIOSLiveTabWebStateUserDataKey)); | 24 web_state->GetUserData(kIOSLiveTabWebStateUserDataKey)); |
| 25 } | 25 } |
| 26 | 26 |
| 27 IOSLiveTab::IOSLiveTab(web::WebState* web_state) : web_state_(web_state) {} | 27 IOSLiveTab::IOSLiveTab(web::WebState* web_state) : web_state_(web_state) {} |
| 28 | 28 |
| 29 IOSLiveTab::~IOSLiveTab() {} | 29 IOSLiveTab::~IOSLiveTab() {} |
| 30 | 30 |
| 31 bool IOSLiveTab::IsInitialNavigation() { | 31 bool IOSLiveTab::IsInitialBlankNavigation() { |
| 32 return navigation_manager()->GetEntryCount() == 0; | 32 return navigation_manager()->GetEntryCount() == 0; |
| 33 } | 33 } |
| 34 | 34 |
| 35 int IOSLiveTab::GetCurrentEntryIndex() { | 35 int IOSLiveTab::GetCurrentEntryIndex() { |
| 36 return navigation_manager()->GetCurrentEntryIndex(); | 36 return navigation_manager()->GetCurrentEntryIndex(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 int IOSLiveTab::GetPendingEntryIndex() { | 39 int IOSLiveTab::GetPendingEntryIndex() { |
| 40 return navigation_manager()->GetPendingItemIndex(); | 40 return navigation_manager()->GetPendingItemIndex(); |
| 41 } | 41 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 57 void IOSLiveTab::LoadIfNecessary() { | 57 void IOSLiveTab::LoadIfNecessary() { |
| 58 navigation_manager()->LoadIfNecessary(); | 58 navigation_manager()->LoadIfNecessary(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 const std::string& IOSLiveTab::GetUserAgentOverride() const { | 61 const std::string& IOSLiveTab::GetUserAgentOverride() const { |
| 62 // Dynamic user agent overrides are not supported on iOS. | 62 // Dynamic user agent overrides are not supported on iOS. |
| 63 return user_agent_override_; | 63 return user_agent_override_; |
| 64 } | 64 } |
| 65 | 65 |
| 66 } // namespace sessions | 66 } // namespace sessions |
| OLD | NEW |