| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 void FrameNavigationState::StartTrackingDocumentLoad( | 70 void FrameNavigationState::StartTrackingDocumentLoad( |
| 71 content::RenderFrameHost* frame_host, | 71 content::RenderFrameHost* frame_host, |
| 72 const GURL& url, | 72 const GURL& url, |
| 73 bool is_same_page, | 73 bool is_same_page, |
| 74 bool is_error_page, | 74 bool is_error_page, |
| 75 bool is_iframe_srcdoc) { | 75 bool is_iframe_srcdoc) { |
| 76 FrameState& frame_state = frame_host_state_map_[frame_host]; | 76 FrameState& frame_state = frame_host_state_map_[frame_host]; |
| 77 frame_state.error_occurred = is_error_page; | 77 frame_state.error_occurred = is_error_page; |
| 78 frame_state.url = url; | 78 frame_state.url = url; |
| 79 frame_state.is_iframe_srcdoc = is_iframe_srcdoc; | 79 frame_state.is_iframe_srcdoc = is_iframe_srcdoc; |
| 80 DCHECK(!is_iframe_srcdoc || url == GURL(url::kAboutBlankURL)); | 80 DCHECK(!is_iframe_srcdoc || url == url::kAboutBlankURL); |
| 81 if (!is_same_page) { | 81 if (!is_same_page) { |
| 82 frame_state.is_loading = true; | 82 frame_state.is_loading = true; |
| 83 frame_state.is_parsing = true; | 83 frame_state.is_parsing = true; |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 | 86 |
| 87 void FrameNavigationState::FrameHostCreated( | 87 void FrameNavigationState::FrameHostCreated( |
| 88 content::RenderFrameHost* frame_host) { | 88 content::RenderFrameHost* frame_host) { |
| 89 frame_hosts_.insert(frame_host); | 89 frame_hosts_.insert(frame_host); |
| 90 } | 90 } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 169 |
| 170 bool FrameNavigationState::GetParsingFinished( | 170 bool FrameNavigationState::GetParsingFinished( |
| 171 content::RenderFrameHost* frame_host) const { | 171 content::RenderFrameHost* frame_host) const { |
| 172 FrameHostToStateMap::const_iterator it = | 172 FrameHostToStateMap::const_iterator it = |
| 173 frame_host_state_map_.find(frame_host); | 173 frame_host_state_map_.find(frame_host); |
| 174 DCHECK(it != frame_host_state_map_.end()); | 174 DCHECK(it != frame_host_state_map_.end()); |
| 175 return it == frame_host_state_map_.end() || !it->second.is_parsing; | 175 return it == frame_host_state_map_.end() || !it->second.is_parsing; |
| 176 } | 176 } |
| 177 | 177 |
| 178 } // namespace extensions | 178 } // namespace extensions |
| OLD | NEW |