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

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

Issue 10392072: Pass the render view host with all provisional load related callbacks on the web contents observer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 7 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 // 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/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 if (!navigation_state_.CanSendEvents(frame_id)) 578 if (!navigation_state_.CanSendEvents(frame_id))
579 return; 579 return;
580 DispatchOnBeforeNavigate( 580 DispatchOnBeforeNavigate(
581 web_contents(), frame_id, is_main_frame, validated_url); 581 web_contents(), frame_id, is_main_frame, validated_url);
582 } 582 }
583 583
584 void WebNavigationTabObserver::DidCommitProvisionalLoadForFrame( 584 void WebNavigationTabObserver::DidCommitProvisionalLoadForFrame(
585 int64 frame_id, 585 int64 frame_id,
586 bool is_main_frame, 586 bool is_main_frame,
587 const GURL& url, 587 const GURL& url,
588 content::PageTransition transition_type) { 588 content::PageTransition transition_type,
589 content::RenderViewHost* render_view_host) {
589 if (!navigation_state_.CanSendEvents(frame_id)) 590 if (!navigation_state_.CanSendEvents(frame_id))
590 return; 591 return;
591 592
592 bool is_reference_fragment_navigation = 593 bool is_reference_fragment_navigation =
593 IsReferenceFragmentNavigation(frame_id, url); 594 IsReferenceFragmentNavigation(frame_id, url);
594 595
595 // Update the URL as it might have changed. 596 // Update the URL as it might have changed.
596 navigation_state_.UpdateFrame(frame_id, url); 597 navigation_state_.UpdateFrame(frame_id, url);
597 navigation_state_.SetNavigationCommitted(frame_id); 598 navigation_state_.SetNavigationCommitted(frame_id);
598 599
(...skipping 19 matching lines...) Expand all
618 url, 619 url,
619 transition_type); 620 transition_type);
620 } 621 }
621 } 622 }
622 623
623 void WebNavigationTabObserver::DidFailProvisionalLoad( 624 void WebNavigationTabObserver::DidFailProvisionalLoad(
624 int64 frame_id, 625 int64 frame_id,
625 bool is_main_frame, 626 bool is_main_frame,
626 const GURL& validated_url, 627 const GURL& validated_url,
627 int error_code, 628 int error_code,
628 const string16& error_description) { 629 const string16& error_description,
630 content::RenderViewHost* render_view_host) {
629 if (!navigation_state_.CanSendEvents(frame_id)) 631 if (!navigation_state_.CanSendEvents(frame_id))
630 return; 632 return;
631 navigation_state_.SetErrorOccurredInFrame(frame_id); 633 navigation_state_.SetErrorOccurredInFrame(frame_id);
632 DispatchOnErrorOccurred( 634 DispatchOnErrorOccurred(
633 web_contents(), validated_url, frame_id, is_main_frame, error_code); 635 web_contents(), validated_url, frame_id, is_main_frame, error_code);
634 } 636 }
635 637
636 void WebNavigationTabObserver::DocumentLoadedInFrame( 638 void WebNavigationTabObserver::DocumentLoadedInFrame(
637 int64 frame_id) { 639 int64 frame_id) {
638 if (!navigation_state_.CanSendEvents(frame_id)) 640 if (!navigation_state_.CanSendEvents(frame_id))
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 frameDict->SetBoolean( 804 frameDict->SetBoolean(
803 keys::kErrorOccurredKey, 805 keys::kErrorOccurredKey,
804 navigation_state.GetErrorOccurredInFrame(*frame)); 806 navigation_state.GetErrorOccurredInFrame(*frame));
805 resultList->Append(frameDict); 807 resultList->Append(frameDict);
806 } 808 }
807 result_.reset(resultList); 809 result_.reset(resultList);
808 return true; 810 return true;
809 } 811 }
810 812
811 } // namespace extensions 813 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698