OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Implementation of ChromeActiveDocument | 5 // Implementation of ChromeActiveDocument |
6 #include "chrome_frame/chrome_active_document.h" | 6 #include "chrome_frame/chrome_active_document.h" |
7 | 7 |
8 #include <hlink.h> | 8 #include <hlink.h> |
9 #include <htiface.h> | 9 #include <htiface.h> |
10 #include <initguid.h> | 10 #include <initguid.h> |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 scoped_refptr<ProtData> prot_data = info->get_prot_data(); | 264 scoped_refptr<ProtData> prot_data = info->get_prot_data(); |
265 if (prot_data) { | 265 if (prot_data) { |
266 referrer = prot_data->referrer(); | 266 referrer = prot_data->referrer(); |
267 renderer_type = prot_data->renderer_type(); | 267 renderer_type = prot_data->renderer_type(); |
268 } | 268 } |
269 } | 269 } |
270 | 270 |
271 // For gcf: URLs allow only about and view-source schemes to pass through for | 271 // For gcf: URLs allow only about and view-source schemes to pass through for |
272 // further inspection. | 272 // further inspection. |
273 bool is_safe_scheme = cf_url.gurl().SchemeIs(chrome::kAboutScheme) || | 273 bool is_safe_scheme = cf_url.gurl().SchemeIs(chrome::kAboutScheme) || |
274 cf_url.gurl().SchemeIs(chrome::kViewSourceScheme); | 274 cf_url.gurl().SchemeIs(content::kViewSourceScheme); |
275 if (cf_url.is_chrome_protocol() && !is_safe_scheme && | 275 if (cf_url.is_chrome_protocol() && !is_safe_scheme && |
276 !GetConfigBool(false, kAllowUnsafeURLs)) { | 276 !GetConfigBool(false, kAllowUnsafeURLs)) { |
277 DLOG(ERROR) << __FUNCTION__ << " gcf: not allowed:" << url; | 277 DLOG(ERROR) << __FUNCTION__ << " gcf: not allowed:" << url; |
278 return E_INVALIDARG; | 278 return E_INVALIDARG; |
279 } | 279 } |
280 | 280 |
281 if (!LaunchUrl(cf_url, referrer)) { | 281 if (!LaunchUrl(cf_url, referrer)) { |
282 DLOG(ERROR) << __FUNCTION__ << " Failed to launch url:" << url; | 282 DLOG(ERROR) << __FUNCTION__ << " Failed to launch url:" << url; |
283 return E_INVALIDARG; | 283 return E_INVALIDARG; |
284 } | 284 } |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 if (tab) { | 865 if (tab) { |
866 if (!find_dialog_.IsWindow()) | 866 if (!find_dialog_.IsWindow()) |
867 find_dialog_.Create(m_hWnd); | 867 find_dialog_.Create(m_hWnd); |
868 | 868 |
869 find_dialog_.ShowWindow(SW_SHOW); | 869 find_dialog_.ShowWindow(SW_SHOW); |
870 } | 870 } |
871 } | 871 } |
872 | 872 |
873 void ChromeActiveDocument::OnViewSource() { | 873 void ChromeActiveDocument::OnViewSource() { |
874 DCHECK(navigation_info_->url.is_valid()); | 874 DCHECK(navigation_info_->url.is_valid()); |
875 HostNavigate(GURL(chrome::kViewSourceScheme + std::string(":") + | 875 HostNavigate(GURL(content::kViewSourceScheme + std::string(":") + |
876 navigation_info_->url.spec()), GURL(), NEW_WINDOW); | 876 navigation_info_->url.spec()), GURL(), NEW_WINDOW); |
877 } | 877 } |
878 | 878 |
879 void ChromeActiveDocument::OnDetermineSecurityZone(const GUID* cmd_group_guid, | 879 void ChromeActiveDocument::OnDetermineSecurityZone(const GUID* cmd_group_guid, |
880 DWORD command_id, | 880 DWORD command_id, |
881 DWORD cmd_exec_opt, | 881 DWORD cmd_exec_opt, |
882 VARIANT* in_args, | 882 VARIANT* in_args, |
883 VARIANT* out_args) { | 883 VARIANT* out_args) { |
884 // Always return URLZONE_INTERNET since that is the Chrome's behaviour. | 884 // Always return URLZONE_INTERNET since that is the Chrome's behaviour. |
885 // Correct step is to use MapUrlToZone(). | 885 // Correct step is to use MapUrlToZone(). |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1431 | 1431 |
1432 return false; | 1432 return false; |
1433 } | 1433 } |
1434 | 1434 |
1435 bool ChromeActiveDocument::IsFirstNavigation( | 1435 bool ChromeActiveDocument::IsFirstNavigation( |
1436 const NavigationInfo& new_navigation_info) const { | 1436 const NavigationInfo& new_navigation_info) const { |
1437 return (navigation_info_->url.is_empty() && | 1437 return (navigation_info_->url.is_empty() && |
1438 new_navigation_info.navigation_type == | 1438 new_navigation_info.navigation_type == |
1439 content::NAVIGATION_TYPE_NEW_PAGE); | 1439 content::NAVIGATION_TYPE_NEW_PAGE); |
1440 } | 1440 } |
OLD | NEW |