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

Side by Side Diff: content/browser/web_contents/navigation_controller_impl.cc

Issue 10544175: Add an ability to call WebKit's WebFrame::loadData via NavigationController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated comments Created 8 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/web_contents/navigation_controller_impl.h" 5 #include "content/browser/web_contents/navigation_controller_impl.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string_number_conversions.h" // Temporary 9 #include "base/string_number_conversions.h" // Temporary
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 // The user initiated a load, we don't need to reload anymore. 580 // The user initiated a load, we don't need to reload anymore.
581 needs_reload_ = false; 581 needs_reload_ = false;
582 582
583 NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry( 583 NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry(
584 CreateNavigationEntry( 584 CreateNavigationEntry(
585 url, referrer, transition, false, extra_headers, browser_context_)); 585 url, referrer, transition, false, extra_headers, browser_context_));
586 586
587 LoadEntry(entry); 587 LoadEntry(entry);
588 } 588 }
589 589
590 void NavigationControllerImpl::LoadDataWithBaseURL(
591 const GURL& data_url,
592 const content::Referrer& referrer,
593 const GURL& base_url,
594 const GURL& history_url,
595 bool is_overriding_user_agent) {
596 needs_reload_ = false;
597
598 NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry(
599 CreateNavigationEntry(
600 data_url,
601 referrer,
602 content::PAGE_TRANSITION_TYPED,
603 false,
604 std::string(),
605 browser_context_));
606 entry->SetIsOverridingUserAgent(is_overriding_user_agent);
607 entry->SetBaseURL(base_url);
608 entry->SetVirtualURL(history_url);
609
610 LoadEntry(entry);
611 }
612
590 void NavigationControllerImpl::LoadURLFromRenderer( 613 void NavigationControllerImpl::LoadURLFromRenderer(
591 const GURL& url, 614 const GURL& url,
592 const content::Referrer& referrer, 615 const content::Referrer& referrer,
593 content::PageTransition transition, 616 content::PageTransition transition,
594 const std::string& extra_headers) { 617 const std::string& extra_headers) {
595 // The user initiated a load, we don't need to reload anymore. 618 // The user initiated a load, we don't need to reload anymore.
596 needs_reload_ = false; 619 needs_reload_ = false;
597 620
598 NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry( 621 NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry(
599 CreateNavigationEntry( 622 CreateNavigationEntry(
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
1432 for (int i = 0; i < max_index; i++) { 1455 for (int i = 0; i < max_index; i++) {
1433 // When cloning a tab, copy all entries except interstitial pages 1456 // When cloning a tab, copy all entries except interstitial pages
1434 if (source.entries_[i].get()->GetPageType() != 1457 if (source.entries_[i].get()->GetPageType() !=
1435 content::PAGE_TYPE_INTERSTITIAL) { 1458 content::PAGE_TYPE_INTERSTITIAL) {
1436 entries_.insert(entries_.begin() + insert_index++, 1459 entries_.insert(entries_.begin() + insert_index++,
1437 linked_ptr<NavigationEntryImpl>( 1460 linked_ptr<NavigationEntryImpl>(
1438 new NavigationEntryImpl(*source.entries_[i]))); 1461 new NavigationEntryImpl(*source.entries_[i])));
1439 } 1462 }
1440 } 1463 }
1441 } 1464 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698