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

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

Issue 23947003: Create WebContentsObserver callbacks for notifications, remove notifications from SSLManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: formatting Created 7 years, 3 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/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_number_conversions.h" // Temporary 10 #include "base/strings/string_number_conversions.h" // Temporary
(...skipping 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after
1551 pending_entry_->restore_type() != NavigationEntryImpl::RESTORE_NONE) { 1551 pending_entry_->restore_type() != NavigationEntryImpl::RESTORE_NONE) {
1552 pending_entry_->set_site_instance(static_cast<SiteInstanceImpl*>( 1552 pending_entry_->set_site_instance(static_cast<SiteInstanceImpl*>(
1553 web_contents_->GetPendingSiteInstance())); 1553 web_contents_->GetPendingSiteInstance()));
1554 pending_entry_->set_restore_type(NavigationEntryImpl::RESTORE_NONE); 1554 pending_entry_->set_restore_type(NavigationEntryImpl::RESTORE_NONE);
1555 } 1555 }
1556 } 1556 }
1557 1557
1558 void NavigationControllerImpl::NotifyNavigationEntryCommitted( 1558 void NavigationControllerImpl::NotifyNavigationEntryCommitted(
1559 LoadCommittedDetails* details) { 1559 LoadCommittedDetails* details) {
1560 details->entry = GetActiveEntry(); 1560 details->entry = GetActiveEntry();
1561 NotificationDetails notification_details =
1562 Details<LoadCommittedDetails>(details);
1563 1561
1564 // We need to notify the ssl_manager_ before the web_contents_ so the 1562 // We need to notify the ssl_manager_ before the web_contents_ so the
1565 // location bar will have up-to-date information about the security style 1563 // location bar will have up-to-date information about the security style
1566 // when it wants to draw. See http://crbug.com/11157 1564 // when it wants to draw. See http://crbug.com/11157
1567 ssl_manager_.DidCommitProvisionalLoad(notification_details); 1565 ssl_manager_.DidCommitProvisionalLoad(*details);
1568 1566
1569 // TODO(pkasting): http://b/1113079 Probably these explicit notification paths
1570 // should be removed, and interested parties should just listen for the
1571 // notification below instead.
1572 web_contents_->NotifyNavigationStateChanged(kInvalidateAll); 1567 web_contents_->NotifyNavigationStateChanged(kInvalidateAll);
1573
1574 web_contents_->NotifyNavigationEntryCommitted(*details); 1568 web_contents_->NotifyNavigationEntryCommitted(*details);
1575 1569
1570 // TODO(avi): Remove. http://crbug.com/170921
1571 NotificationDetails notification_details =
1572 Details<LoadCommittedDetails>(details);
1576 NotificationService::current()->Notify( 1573 NotificationService::current()->Notify(
1577 NOTIFICATION_NAV_ENTRY_COMMITTED, 1574 NOTIFICATION_NAV_ENTRY_COMMITTED,
1578 Source<NavigationController>(this), 1575 Source<NavigationController>(this),
1579 notification_details); 1576 notification_details);
1580 } 1577 }
1581 1578
1582 // static 1579 // static
1583 size_t NavigationControllerImpl::max_entry_count() { 1580 size_t NavigationControllerImpl::max_entry_count() {
1584 if (max_entry_count_for_testing_ != kMaxEntryCountForTestingNotSet) 1581 if (max_entry_count_for_testing_ != kMaxEntryCountForTestingNotSet)
1585 return max_entry_count_for_testing_; 1582 return max_entry_count_for_testing_;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
1685 } 1682 }
1686 } 1683 }
1687 } 1684 }
1688 1685
1689 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 1686 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
1690 const base::Callback<base::Time()>& get_timestamp_callback) { 1687 const base::Callback<base::Time()>& get_timestamp_callback) {
1691 get_timestamp_callback_ = get_timestamp_callback; 1688 get_timestamp_callback_ = get_timestamp_callback;
1692 } 1689 }
1693 1690
1694 } // namespace content 1691 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/navigation_controller_impl.h ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698