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

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

Issue 325443002: Move about://-related constants from //content to //url (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Android ifx Created 6 years, 6 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 #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 "chrome/common/url_constants.h" 8 #include "chrome/common/url_constants.h"
9 #include "extensions/common/constants.h" 9 #include "extensions/common/constants.h"
10 10
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 74 }
75 return IsValidUrl(frame_state->second.url); 75 return IsValidUrl(frame_state->second.url);
76 } 76 }
77 77
78 bool FrameNavigationState::IsValidUrl(const GURL& url) const { 78 bool FrameNavigationState::IsValidUrl(const GURL& url) const {
79 for (unsigned i = 0; i < arraysize(kValidSchemes); ++i) { 79 for (unsigned i = 0; i < arraysize(kValidSchemes); ++i) {
80 if (url.scheme() == kValidSchemes[i]) 80 if (url.scheme() == kValidSchemes[i])
81 return true; 81 return true;
82 } 82 }
83 // Allow about:blank and about:srcdoc. 83 // Allow about:blank and about:srcdoc.
84 if (url.spec() == content::kAboutBlankURL || 84 if (url.spec() == url::kAboutBlankURL ||
85 url.spec() == content::kAboutSrcDocURL) { 85 url.spec() == content::kAboutSrcDocURL) {
86 return true; 86 return true;
87 } 87 }
88 if (allow_extension_scheme_ && url.scheme() == extensions::kExtensionScheme) 88 if (allow_extension_scheme_ && url.scheme() == extensions::kExtensionScheme)
89 return true; 89 return true;
90 return false; 90 return false;
91 } 91 }
92 92
93 void FrameNavigationState::TrackFrame(FrameID frame_id, 93 void FrameNavigationState::TrackFrame(FrameID frame_id,
94 FrameID parent_frame_id, 94 FrameID parent_frame_id,
95 const GURL& url, 95 const GURL& url,
96 bool is_main_frame, 96 bool is_main_frame,
97 bool is_error_page, 97 bool is_error_page,
98 bool is_iframe_srcdoc) { 98 bool is_iframe_srcdoc) {
99 FrameState& frame_state = frame_state_map_[frame_id]; 99 FrameState& frame_state = frame_state_map_[frame_id];
100 frame_state.error_occurred = is_error_page; 100 frame_state.error_occurred = is_error_page;
101 frame_state.url = url; 101 frame_state.url = url;
102 frame_state.is_main_frame = is_main_frame; 102 frame_state.is_main_frame = is_main_frame;
103 frame_state.is_iframe_srcdoc = is_iframe_srcdoc; 103 frame_state.is_iframe_srcdoc = is_iframe_srcdoc;
104 DCHECK(!is_iframe_srcdoc || url == GURL(content::kAboutBlankURL)); 104 DCHECK(!is_iframe_srcdoc || url == GURL(url::kAboutBlankURL));
105 frame_state.is_navigating = true; 105 frame_state.is_navigating = true;
106 frame_state.is_committed = false; 106 frame_state.is_committed = false;
107 frame_state.is_server_redirected = false; 107 frame_state.is_server_redirected = false;
108 frame_state.is_parsing = true; 108 frame_state.is_parsing = true;
109 if (!is_main_frame) { 109 if (!is_main_frame) {
110 frame_state.parent_frame_num = parent_frame_id.frame_num; 110 frame_state.parent_frame_num = parent_frame_id.frame_num;
111 } else { 111 } else {
112 DCHECK(parent_frame_id.frame_num == -1); 112 DCHECK(parent_frame_id.frame_num == -1);
113 frame_state.parent_frame_num = -1; 113 frame_state.parent_frame_num = -1;
114 } 114 }
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 } 262 }
263 263
264 bool FrameNavigationState::GetIsServerRedirected(FrameID frame_id) const { 264 bool FrameNavigationState::GetIsServerRedirected(FrameID frame_id) const {
265 FrameIdToStateMap::const_iterator frame_state = 265 FrameIdToStateMap::const_iterator frame_state =
266 frame_state_map_.find(frame_id); 266 frame_state_map_.find(frame_id);
267 return (frame_state != frame_state_map_.end() && 267 return (frame_state != frame_state_map_.end() &&
268 frame_state->second.is_server_redirected); 268 frame_state->second.is_server_redirected);
269 } 269 }
270 270
271 } // namespace extensions 271 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_test.cc ('k') | chrome/browser/extensions/api/web_navigation/web_navigation_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698