Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(385)

Side by Side Diff: ios/web/navigation/navigation_manager_impl.mm

Issue 2756483006: Adds NavigationManager util functions to ios/chrome/browser/web/ (Closed)
Patch Set: changed #include to #import and minor renaming. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ios/web/navigation/navigation_manager_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #import "ios/web/navigation/navigation_manager_impl.h" 5 #import "ios/web/navigation/navigation_manager_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 use_desktop_user_agent = 210 use_desktop_user_agent =
211 last_non_native_item && 211 last_non_native_item &&
212 last_non_native_item->GetUserAgentType() == UserAgentType::DESKTOP; 212 last_non_native_item->GetUserAgentType() == UserAgentType::DESKTOP;
213 } 213 }
214 if (use_desktop_user_agent) 214 if (use_desktop_user_agent)
215 pending_item->SetUserAgentType(UserAgentType::DESKTOP); 215 pending_item->SetUserAgentType(UserAgentType::DESKTOP);
216 } 216 }
217 override_desktop_user_agent_for_next_pending_item_ = false; 217 override_desktop_user_agent_for_next_pending_item_ = false;
218 } 218 }
219 219
220 NavigationItem* NavigationManagerImpl::GetLastUserItem() const {
221 return [session_controller_ lastUserItem];
222 }
223
224 NavigationItemList NavigationManagerImpl::GetItems() const { 220 NavigationItemList NavigationManagerImpl::GetItems() const {
225 return CreateNavigationItemList([session_controller_ items]); 221 return CreateNavigationItemList([session_controller_ items]);
226 } 222 }
227 223
228 BrowserState* NavigationManagerImpl::GetBrowserState() const { 224 BrowserState* NavigationManagerImpl::GetBrowserState() const {
229 return browser_state_; 225 return browser_state_;
230 } 226 }
231 227
232 WebState* NavigationManagerImpl::GetWebState() const { 228 WebState* NavigationManagerImpl::GetWebState() const {
233 return delegate_->GetWebState(); 229 return delegate_->GetWebState();
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 const ScopedNavigationItemImplList& items = [session_controller_ items]; 463 const ScopedNavigationItemImplList& items = [session_controller_ items];
468 while (index >= 0) { 464 while (index >= 0) {
469 NavigationItem* item = items[index--].get(); 465 NavigationItem* item = items[index--].get();
470 if (!client->IsAppSpecificURL(item->GetVirtualURL())) 466 if (!client->IsAppSpecificURL(item->GetVirtualURL()))
471 return item; 467 return item;
472 } 468 }
473 return nullptr; 469 return nullptr;
474 } 470 }
475 471
476 } // namespace web 472 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/navigation/navigation_manager_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698