summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/provisional_load_details.cc6
-rw-r--r--chrome/browser/tab_contents/provisional_load_details.h6
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc17
-rw-r--r--chrome/browser/tab_contents/tab_contents.h2
4 files changed, 23 insertions, 8 deletions
diff --git a/chrome/browser/tab_contents/provisional_load_details.cc b/chrome/browser/tab_contents/provisional_load_details.cc
index e1e85d2..dedf3e8 100644
--- a/chrome/browser/tab_contents/provisional_load_details.cc
+++ b/chrome/browser/tab_contents/provisional_load_details.cc
@@ -11,7 +11,8 @@ ProvisionalLoadDetails::ProvisionalLoadDetails(bool is_main_frame,
bool is_in_page_navigation,
const GURL& url,
const std::string& security_info,
- bool is_content_filtered)
+ bool is_content_filtered,
+ long long frame_id)
: error_code_(net::OK),
transition_type_(PageTransition::LINK),
url_(url),
@@ -21,7 +22,8 @@ ProvisionalLoadDetails::ProvisionalLoadDetails(bool is_main_frame,
ssl_cert_status_(0),
ssl_security_bits_(-1),
ssl_connection_status_(0),
- is_content_filtered_(is_content_filtered) {
+ is_content_filtered_(is_content_filtered),
+ frame_id_(frame_id) {
SSLManager::DeserializeSecurityInfo(security_info,
&ssl_cert_id_,
&ssl_cert_status_,
diff --git a/chrome/browser/tab_contents/provisional_load_details.h b/chrome/browser/tab_contents/provisional_load_details.h
index 2073db0..a9b0baa 100644
--- a/chrome/browser/tab_contents/provisional_load_details.h
+++ b/chrome/browser/tab_contents/provisional_load_details.h
@@ -27,7 +27,8 @@ class ProvisionalLoadDetails {
bool in_page_navigation,
const GURL& url,
const std::string& security_info,
- bool is_filtered);
+ bool is_filtered,
+ long long frame_id);
virtual ~ProvisionalLoadDetails() { }
void set_error_code(int error_code) { error_code_ = error_code; }
@@ -56,6 +57,8 @@ class ProvisionalLoadDetails {
bool is_content_filtered() const { return is_content_filtered_; }
+ long long frame_id() const { return frame_id_; }
+
private:
int error_code_;
PageTransition::Type transition_type_;
@@ -67,6 +70,7 @@ class ProvisionalLoadDetails {
int ssl_security_bits_;
int ssl_connection_status_;
bool is_content_filtered_;
+ long long frame_id_;
DISALLOW_COPY_AND_ASSIGN(ProvisionalLoadDetails);
};
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 486e52c..3c05931 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -2093,11 +2093,12 @@ void TabContents::OnSetSuggestResult(int32 page_id, const std::string& result) {
void TabContents::DidStartProvisionalLoadForFrame(
RenderViewHost* render_view_host,
+ long long frame_id,
bool is_main_frame,
const GURL& url) {
ProvisionalLoadDetails details(is_main_frame,
controller_.IsURLInPageNavigation(url),
- url, std::string(), false);
+ url, std::string(), false, frame_id);
NotificationService::current()->Notify(
NotificationType::FRAME_PROVISIONAL_LOAD_START,
Source<NavigationController>(&controller_),
@@ -2156,6 +2157,7 @@ void TabContents::DidRunInsecureContent(const std::string& security_origin) {
void TabContents::DidFailProvisionalLoadWithError(
RenderViewHost* render_view_host,
+ long long frame_id,
bool is_main_frame,
int error_code,
const GURL& url,
@@ -2201,7 +2203,7 @@ void TabContents::DidFailProvisionalLoadWithError(
// Send out a notification that we failed a provisional load with an error.
ProvisionalLoadDetails details(is_main_frame,
controller_.IsURLInPageNavigation(url),
- url, std::string(), false);
+ url, std::string(), false, frame_id);
details.set_error_code(error_code);
NotificationService::current()->Notify(
@@ -2429,9 +2431,14 @@ void TabContents::DidNavigate(RenderViewHost* rvh,
// different from the NAV_ENTRY_COMMITTED notification which doesn't include
// the actual URL navigated to and isn't sent for AUTO_SUBFRAME navigations.
if (details.type != NavigationType::NAV_IGNORE) {
- ProvisionalLoadDetails load_details(details.is_main_frame,
- details.is_in_page,
- params.url, std::string(), false);
+ // For AUTO_SUBFRAME navigations, an event for the main frame is generated
+ // that is not recorded in the navigation history. For the purpose of
+ // tracking navigation events, we treat this event as a sub frame navigation
+ // event.
+ bool is_main_frame = did_navigate ? details.is_main_frame : false;
+ ProvisionalLoadDetails load_details(
+ is_main_frame, details.is_in_page, params.url, std::string(), false,
+ params.frame_id);
load_details.set_transition_type(params.transition);
// Whether or not a page transition was triggered by going backward or
// forward in the history is only stored in the navigation controller's
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h
index b8264fc..f770c42 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -869,6 +869,7 @@ class TabContents : public PageNavigator,
// RenderViewHostDelegate::Resource implementation.
virtual void DidStartProvisionalLoadForFrame(RenderViewHost* render_view_host,
+ long long frame_id,
bool is_main_frame,
const GURL& url);
virtual void DidStartReceivingResourceResponse(
@@ -887,6 +888,7 @@ class TabContents : public PageNavigator,
virtual void DidRunInsecureContent(const std::string& security_origin);
virtual void DidFailProvisionalLoadWithError(
RenderViewHost* render_view_host,
+ long long frame_id,
bool is_main_frame,
int error_code,
const GURL& url,