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/renderer/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug/crash_logging.h" | 8 #include "base/debug/crash_logging.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1016 WebPluginParams* params) { | 1016 WebPluginParams* params) { |
1017 // Temporarily allow these whitelisted apps and WebUIs to use NaCl. | 1017 // Temporarily allow these whitelisted apps and WebUIs to use NaCl. |
1018 std::string app_url_host = app_url.host(); | 1018 std::string app_url_host = app_url.host(); |
1019 std::string manifest_url_path = manifest_url.path(); | 1019 std::string manifest_url_path = manifest_url.path(); |
1020 | 1020 |
1021 bool is_whitelisted_web_ui = | 1021 bool is_whitelisted_web_ui = |
1022 app_url.spec() == chrome::kChromeUIAppListStartPageURL; | 1022 app_url.spec() == chrome::kChromeUIAppListStartPageURL; |
1023 | 1023 |
1024 bool is_photo_app = | 1024 bool is_photo_app = |
1025 // Whitelisted apps must be served over https. | 1025 // Whitelisted apps must be served over https. |
1026 app_url.SchemeIs("https") && | 1026 app_url.SchemeIsCryptographic() && manifest_url.SchemeIsCryptographic() && |
1027 manifest_url.SchemeIs("https") && | |
1028 (EndsWith(app_url_host, "plus.google.com", false) || | 1027 (EndsWith(app_url_host, "plus.google.com", false) || |
1029 EndsWith(app_url_host, "plus.sandbox.google.com", false)) && | 1028 EndsWith(app_url_host, "plus.sandbox.google.com", false)) && |
1030 manifest_url.DomainIs("ssl.gstatic.com") && | 1029 manifest_url.DomainIs("ssl.gstatic.com") && |
1031 (manifest_url_path.find("s2/oz/nacl/") == 1 || | 1030 (manifest_url_path.find("s2/oz/nacl/") == 1 || |
1032 manifest_url_path.find("photos/nacl/") == 1); | 1031 manifest_url_path.find("photos/nacl/") == 1); |
1033 | 1032 |
1034 std::string manifest_fs_host; | 1033 std::string manifest_fs_host; |
1035 if (manifest_url.SchemeIsFileSystem() && manifest_url.inner_url()) { | 1034 if (manifest_url.SchemeIsFileSystem() && manifest_url.inner_url()) { |
1036 manifest_fs_host = manifest_url.inner_url()->host(); | 1035 manifest_fs_host = manifest_url.inner_url()->host(); |
1037 } | 1036 } |
1038 bool is_hangouts_app = | 1037 bool is_hangouts_app = |
1039 // Whitelisted apps must be served over secure scheme. | 1038 // Whitelisted apps must be served over secure scheme. |
1040 app_url.SchemeIs("https") && | 1039 app_url.SchemeIsCryptographic() && manifest_url.SchemeIsFileSystem() && |
1041 manifest_url.SchemeIsSecure() && | 1040 manifest_url.inner_url()->SchemeIsCryptographic() && |
1042 manifest_url.SchemeIsFileSystem() && | |
1043 (EndsWith(app_url_host, "talkgadget.google.com", false) || | 1041 (EndsWith(app_url_host, "talkgadget.google.com", false) || |
1044 EndsWith(app_url_host, "plus.google.com", false) || | 1042 EndsWith(app_url_host, "plus.google.com", false) || |
1045 EndsWith(app_url_host, "plus.sandbox.google.com", false)) && | 1043 EndsWith(app_url_host, "plus.sandbox.google.com", false)) && |
1046 // The manifest must be loaded from the host's FileSystem. | 1044 // The manifest must be loaded from the host's FileSystem. |
1047 (manifest_fs_host == app_url_host); | 1045 (manifest_fs_host == app_url_host); |
1048 | 1046 |
1049 bool is_whitelisted_app = is_photo_app || is_hangouts_app; | 1047 bool is_whitelisted_app = is_photo_app || is_hangouts_app; |
1050 | 1048 |
1051 bool is_extension_from_webstore = false; | 1049 bool is_extension_from_webstore = false; |
1052 bool is_invoked_by_hosted_app = false; | 1050 bool is_invoked_by_hosted_app = false; |
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1648 const GURL& url) { | 1646 const GURL& url) { |
1649 RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRapporURL(metric, url)); | 1647 RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRapporURL(metric, url)); |
1650 } | 1648 } |
1651 | 1649 |
1652 scoped_ptr<blink::WebAppBannerClient> | 1650 scoped_ptr<blink::WebAppBannerClient> |
1653 ChromeContentRendererClient::CreateAppBannerClient( | 1651 ChromeContentRendererClient::CreateAppBannerClient( |
1654 content::RenderFrame* render_frame) { | 1652 content::RenderFrame* render_frame) { |
1655 return scoped_ptr<blink::WebAppBannerClient>( | 1653 return scoped_ptr<blink::WebAppBannerClient>( |
1656 new AppBannerClient(render_frame)); | 1654 new AppBannerClient(render_frame)); |
1657 } | 1655 } |
OLD | NEW |