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

Side by Side Diff: chrome/browser/extensions/api/web_navigation/web_navigation_api.cc

Issue 2345053006: Remove IsSynchronous API from NavigationHandle. (Closed)
Patch Set: Addressed review comments. Created 4 years, 1 month 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
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 // Implements the Chrome Extensions WebNavigation API. 5 // Implements the Chrome Extensions WebNavigation API.
6 6
7 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" 7 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h"
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 if (old_host) { 261 if (old_host) {
262 RenderFrameDeleted(old_host); 262 RenderFrameDeleted(old_host);
263 navigation_state_.FrameHostDeleted(old_host); 263 navigation_state_.FrameHostDeleted(old_host);
264 } 264 }
265 265
266 navigation_state_.FrameHostCreated(new_host); 266 navigation_state_.FrameHostCreated(new_host);
267 } 267 }
268 268
269 void WebNavigationTabObserver::DidStartNavigation( 269 void WebNavigationTabObserver::DidStartNavigation(
270 content::NavigationHandle* navigation_handle) { 270 content::NavigationHandle* navigation_handle) {
271 if (navigation_handle->IsSynchronousNavigation() || 271 if (navigation_handle->IsSamePage() ||
272 !FrameNavigationState::IsValidUrl(navigation_handle->GetURL())) { 272 !FrameNavigationState::IsValidUrl(navigation_handle->GetURL())) {
273 return; 273 return;
274 } 274 }
275 275
276 helpers::DispatchOnBeforeNavigate(navigation_handle); 276 helpers::DispatchOnBeforeNavigate(navigation_handle);
277 } 277 }
278 278
279 void WebNavigationTabObserver::DidFinishNavigation( 279 void WebNavigationTabObserver::DidFinishNavigation(
280 content::NavigationHandle* navigation_handle) { 280 content::NavigationHandle* navigation_handle) {
281 if (navigation_handle->HasCommitted() && !navigation_handle->IsErrorPage()) { 281 if (navigation_handle->HasCommitted() && !navigation_handle->IsErrorPage()) {
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 return g_factory.Pointer(); 562 return g_factory.Pointer();
563 } 563 }
564 564
565 void WebNavigationAPI::OnListenerAdded(const EventListenerInfo& details) { 565 void WebNavigationAPI::OnListenerAdded(const EventListenerInfo& details) {
566 web_navigation_event_router_.reset(new WebNavigationEventRouter( 566 web_navigation_event_router_.reset(new WebNavigationEventRouter(
567 Profile::FromBrowserContext(browser_context_))); 567 Profile::FromBrowserContext(browser_context_)));
568 EventRouter::Get(browser_context_)->UnregisterObserver(this); 568 EventRouter::Get(browser_context_)->UnregisterObserver(this);
569 } 569 }
570 570
571 } // namespace extensions 571 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698