| 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 "ios/web/web_state/web_state_impl.h" | 5 #include "ios/web/web_state/web_state_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 CHECK(web::GetWebClient()->IsAppSpecificURL(url)); | 271 CHECK(web::GetWebClient()->IsAppSpecificURL(url)); |
| 272 [web_controller_ loadHTML:base::SysUTF16ToNSString(html) | 272 [web_controller_ loadHTML:base::SysUTF16ToNSString(html) |
| 273 forAppSpecificURL:url]; | 273 forAppSpecificURL:url]; |
| 274 } | 274 } |
| 275 | 275 |
| 276 const base::string16& WebStateImpl::GetTitle() const { | 276 const base::string16& WebStateImpl::GetTitle() const { |
| 277 // TODO(stuartmorgan): Implement the NavigationManager logic necessary to | 277 // TODO(stuartmorgan): Implement the NavigationManager logic necessary to |
| 278 // match the WebContents implementation of this method. | 278 // match the WebContents implementation of this method. |
| 279 DCHECK(Configured()); | 279 DCHECK(Configured()); |
| 280 web::NavigationItem* item = navigation_manager_.GetLastCommittedItem(); | 280 web::NavigationItem* item = navigation_manager_.GetLastCommittedItem(); |
| 281 if (item) { | 281 return item ? item->GetTitleForDisplay() : empty_string16_; |
| 282 return item->GetTitleForDisplay( | |
| 283 web::GetWebClient()->GetAcceptLangs(GetBrowserState())); | |
| 284 } | |
| 285 return empty_string16_; | |
| 286 } | 282 } |
| 287 | 283 |
| 288 void WebStateImpl::ShowTransientContentView(CRWContentView* content_view) { | 284 void WebStateImpl::ShowTransientContentView(CRWContentView* content_view) { |
| 289 DCHECK(Configured()); | 285 DCHECK(Configured()); |
| 290 DCHECK(content_view); | 286 DCHECK(content_view); |
| 291 DCHECK(content_view.scrollView); | 287 DCHECK(content_view.scrollView); |
| 292 [web_controller_ showTransientContentView:content_view]; | 288 [web_controller_ showTransientContentView:content_view]; |
| 293 } | 289 } |
| 294 | 290 |
| 295 bool WebStateImpl::IsShowingWebInterstitial() const { | 291 bool WebStateImpl::IsShowingWebInterstitial() const { |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 const LoadCommittedDetails& load_details) { | 566 const LoadCommittedDetails& load_details) { |
| 571 FOR_EACH_OBSERVER(WebStateObserver, observers_, | 567 FOR_EACH_OBSERVER(WebStateObserver, observers_, |
| 572 NavigationItemCommitted(load_details)); | 568 NavigationItemCommitted(load_details)); |
| 573 } | 569 } |
| 574 | 570 |
| 575 WebState* WebStateImpl::GetWebState() { | 571 WebState* WebStateImpl::GetWebState() { |
| 576 return this; | 572 return this; |
| 577 } | 573 } |
| 578 | 574 |
| 579 } // namespace web | 575 } // namespace web |
| OLD | NEW |