| 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 "base/strings/sys_string_conversions.h" | 7 #include "base/strings/sys_string_conversions.h" |
| 8 #include "ios/web/interstitials/web_interstitial_impl.h" | 8 #include "ios/web/interstitials/web_interstitial_impl.h" |
| 9 #import "ios/web/navigation/crw_session_controller.h" | 9 #import "ios/web/navigation/crw_session_controller.h" |
| 10 #import "ios/web/navigation/crw_session_entry.h" | 10 #import "ios/web/navigation/crw_session_entry.h" |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 const std::string& message, | 240 const std::string& message, |
| 241 const base::ListValue& args) { | 241 const base::ListValue& args) { |
| 242 if (web_ui_) { | 242 if (web_ui_) { |
| 243 DCHECK(!facade_delegate_ || !facade_delegate_->HasLegacyWebUI()); | 243 DCHECK(!facade_delegate_ || !facade_delegate_->HasLegacyWebUI()); |
| 244 web_ui_->ProcessWebUIIOSMessage(source_url, message, args); | 244 web_ui_->ProcessWebUIIOSMessage(source_url, message, args); |
| 245 } else if (facade_delegate_) { | 245 } else if (facade_delegate_) { |
| 246 facade_delegate_->ProcessLegacyWebUIMessage(source_url, message, args); | 246 facade_delegate_->ProcessLegacyWebUIMessage(source_url, message, args); |
| 247 } | 247 } |
| 248 } | 248 } |
| 249 | 249 |
| 250 void WebStateImpl::LoadWebUIHtml(const base::string16& html, const GURL& url) { |
| 251 CHECK(web::GetWebClient()->IsAppSpecificURL(url)); |
| 252 [web_controller_ loadHTML:base::SysUTF16ToNSString(html) |
| 253 forAppSpecificURL:url]; |
| 254 } |
| 255 |
| 250 const base::string16& WebStateImpl::GetTitle() const { | 256 const base::string16& WebStateImpl::GetTitle() const { |
| 251 // TODO(stuartmorgan): Implement the NavigationManager logic necessary to | 257 // TODO(stuartmorgan): Implement the NavigationManager logic necessary to |
| 252 // match the WebContents implementation of this method. | 258 // match the WebContents implementation of this method. |
| 253 DCHECK(Configured()); | 259 DCHECK(Configured()); |
| 254 web::NavigationItem* item = navigation_manager_.GetLastCommittedItem(); | 260 web::NavigationItem* item = navigation_manager_.GetLastCommittedItem(); |
| 255 if (item) { | 261 if (item) { |
| 256 return item->GetTitleForDisplay( | 262 return item->GetTitleForDisplay( |
| 257 web::GetWebClient()->GetAcceptLangs(GetBrowserState())); | 263 web::GetWebClient()->GetAcceptLangs(GetBrowserState())); |
| 258 } | 264 } |
| 259 return empty_string16_; | 265 return empty_string16_; |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 const LoadCommittedDetails& load_details) { | 529 const LoadCommittedDetails& load_details) { |
| 524 FOR_EACH_OBSERVER(WebStateObserver, observers_, | 530 FOR_EACH_OBSERVER(WebStateObserver, observers_, |
| 525 NavigationItemCommitted(load_details)); | 531 NavigationItemCommitted(load_details)); |
| 526 } | 532 } |
| 527 | 533 |
| 528 WebState* WebStateImpl::GetWebState() { | 534 WebState* WebStateImpl::GetWebState() { |
| 529 return this; | 535 return this; |
| 530 } | 536 } |
| 531 | 537 |
| 532 } // namespace web | 538 } // namespace web |
| OLD | NEW |