OLD | NEW |
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 "chrome/browser/extensions/api/web_navigation/frame_navigation_state.h" | 5 #include "chrome/browser/extensions/api/web_navigation/frame_navigation_state.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
10 #include "content/public/browser/render_frame_host.h" | 10 #include "content/public/browser/render_frame_host.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 frame_host_state_map_.find(frame_host); | 62 frame_host_state_map_.find(frame_host); |
63 if (it == frame_host_state_map_.end() || it->second.error_occurred) { | 63 if (it == frame_host_state_map_.end() || it->second.error_occurred) { |
64 return false; | 64 return false; |
65 } | 65 } |
66 return IsValidUrl(it->second.url); | 66 return IsValidUrl(it->second.url); |
67 } | 67 } |
68 | 68 |
69 void FrameNavigationState::StartTrackingDocumentLoad( | 69 void FrameNavigationState::StartTrackingDocumentLoad( |
70 content::RenderFrameHost* frame_host, | 70 content::RenderFrameHost* frame_host, |
71 const GURL& url, | 71 const GURL& url, |
72 bool is_same_page, | 72 bool is_same_document, |
73 bool is_error_page) { | 73 bool is_error_page) { |
74 FrameState& frame_state = frame_host_state_map_[frame_host]; | 74 FrameState& frame_state = frame_host_state_map_[frame_host]; |
75 frame_state.error_occurred = is_error_page; | 75 frame_state.error_occurred = is_error_page; |
76 frame_state.url = url; | 76 frame_state.url = url; |
77 if (!is_same_page) { | 77 if (!is_same_document) { |
78 frame_state.is_loading = true; | 78 frame_state.is_loading = true; |
79 frame_state.is_parsing = true; | 79 frame_state.is_parsing = true; |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 void FrameNavigationState::FrameHostCreated( | 83 void FrameNavigationState::FrameHostCreated( |
84 content::RenderFrameHost* frame_host) { | 84 content::RenderFrameHost* frame_host) { |
85 frame_hosts_.insert(frame_host); | 85 frame_hosts_.insert(frame_host); |
86 } | 86 } |
87 | 87 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 163 |
164 bool FrameNavigationState::GetParsingFinished( | 164 bool FrameNavigationState::GetParsingFinished( |
165 content::RenderFrameHost* frame_host) const { | 165 content::RenderFrameHost* frame_host) const { |
166 FrameHostToStateMap::const_iterator it = | 166 FrameHostToStateMap::const_iterator it = |
167 frame_host_state_map_.find(frame_host); | 167 frame_host_state_map_.find(frame_host); |
168 DCHECK(it != frame_host_state_map_.end()); | 168 DCHECK(it != frame_host_state_map_.end()); |
169 return it == frame_host_state_map_.end() || !it->second.is_parsing; | 169 return it == frame_host_state_map_.end() || !it->second.is_parsing; |
170 } | 170 } |
171 | 171 |
172 } // namespace extensions | 172 } // namespace extensions |
OLD | NEW |