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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 #include "chrome/browser/tab_contents/tab_util.h" | 75 #include "chrome/browser/tab_contents/tab_util.h" |
76 #include "chrome/browser/ui/blocked_content/blocked_window_params.h" | 76 #include "chrome/browser/ui/blocked_content/blocked_window_params.h" |
77 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 77 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
78 #include "chrome/browser/ui/chrome_select_file_policy.h" | 78 #include "chrome/browser/ui/chrome_select_file_policy.h" |
79 #include "chrome/browser/ui/sync/sync_promo_ui.h" | 79 #include "chrome/browser/ui/sync/sync_promo_ui.h" |
80 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" | 80 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" |
81 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 81 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
82 #include "chrome/common/chrome_constants.h" | 82 #include "chrome/common/chrome_constants.h" |
83 #include "chrome/common/chrome_paths.h" | 83 #include "chrome/common/chrome_paths.h" |
84 #include "chrome/common/chrome_switches.h" | 84 #include "chrome/common/chrome_switches.h" |
| 85 #include "chrome/common/content_settings.h" |
85 #include "chrome/common/env_vars.h" | 86 #include "chrome/common/env_vars.h" |
86 #include "chrome/common/logging_chrome.h" | 87 #include "chrome/common/logging_chrome.h" |
87 #include "chrome/common/pepper_permission_util.h" | 88 #include "chrome/common/pepper_permission_util.h" |
88 #include "chrome/common/pref_names.h" | 89 #include "chrome/common/pref_names.h" |
89 #include "chrome/common/render_messages.h" | 90 #include "chrome/common/render_messages.h" |
90 #include "chrome/common/url_constants.h" | 91 #include "chrome/common/url_constants.h" |
91 #include "chrome/installer/util/google_update_settings.h" | 92 #include "chrome/installer/util/google_update_settings.h" |
92 #include "chromeos/chromeos_constants.h" | 93 #include "chromeos/chromeos_constants.h" |
93 #include "components/cdm/browser/cdm_message_filter_android.h" | 94 #include "components/cdm/browser/cdm_message_filter_android.h" |
94 #include "components/cloud_devices/common/cloud_devices_switches.h" | 95 #include "components/cloud_devices/common/cloud_devices_switches.h" |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 | 810 |
810 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( | 811 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( |
811 profile->IsOffTheRecord())); | 812 profile->IsOffTheRecord())); |
812 | 813 |
813 for (size_t i = 0; i < extra_parts_.size(); ++i) | 814 for (size_t i = 0; i < extra_parts_.size(); ++i) |
814 extra_parts_[i]->RenderProcessWillLaunch(host); | 815 extra_parts_[i]->RenderProcessWillLaunch(host); |
815 | 816 |
816 RendererContentSettingRules rules; | 817 RendererContentSettingRules rules; |
817 if (host->IsIsolatedGuest()) { | 818 if (host->IsIsolatedGuest()) { |
818 #if defined(ENABLE_EXTENSIONS) | 819 #if defined(ENABLE_EXTENSIONS) |
819 GuestViewBase::GetDefaultContentSettingRules(&rules, | 820 GetGuestViewDefaultContentSettingRules(profile->IsOffTheRecord(), &rules); |
820 profile->IsOffTheRecord()); | |
821 #else | 821 #else |
822 NOTREACHED(); | 822 NOTREACHED(); |
823 #endif | 823 #endif |
824 } else { | 824 } else { |
825 GetRendererContentSettingRules( | 825 GetRendererContentSettingRules( |
826 profile->GetHostContentSettingsMap(), &rules); | 826 profile->GetHostContentSettingsMap(), &rules); |
827 } | 827 } |
828 host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); | 828 host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); |
829 } | 829 } |
830 | 830 |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1564 bool allowed_by_default, | 1564 bool allowed_by_default, |
1565 const base::Callback<void(bool)>& callback) { | 1565 const base::Callback<void(bool)>& callback) { |
1566 DCHECK(BrowserThread:: CurrentlyOn(BrowserThread::UI)); | 1566 DCHECK(BrowserThread:: CurrentlyOn(BrowserThread::UI)); |
1567 WebViewPermissionHelper* web_view_permission_helper = | 1567 WebViewPermissionHelper* web_view_permission_helper = |
1568 WebViewPermissionHelper::FromFrameID(render_process_id, | 1568 WebViewPermissionHelper::FromFrameID(render_process_id, |
1569 render_frame_id); | 1569 render_frame_id); |
1570 web_view_permission_helper->RequestFileSystemPermission(url, | 1570 web_view_permission_helper->RequestFileSystemPermission(url, |
1571 allowed_by_default, | 1571 allowed_by_default, |
1572 callback); | 1572 callback); |
1573 } | 1573 } |
| 1574 |
| 1575 void ChromeContentBrowserClient::GetGuestViewDefaultContentSettingRules( |
| 1576 bool incognito, |
| 1577 RendererContentSettingRules* rules) { |
| 1578 rules->image_rules.push_back( |
| 1579 ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), |
| 1580 ContentSettingsPattern::Wildcard(), |
| 1581 CONTENT_SETTING_ALLOW, |
| 1582 std::string(), |
| 1583 incognito)); |
| 1584 |
| 1585 rules->script_rules.push_back( |
| 1586 ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), |
| 1587 ContentSettingsPattern::Wildcard(), |
| 1588 CONTENT_SETTING_ALLOW, |
| 1589 std::string(), |
| 1590 incognito)); |
| 1591 } |
1574 #endif | 1592 #endif |
1575 | 1593 |
1576 void ChromeContentBrowserClient::FileSystemAccessed( | 1594 void ChromeContentBrowserClient::FileSystemAccessed( |
1577 const GURL& url, | 1595 const GURL& url, |
1578 const std::vector<std::pair<int, int> >& render_frames, | 1596 const std::vector<std::pair<int, int> >& render_frames, |
1579 base::Callback<void(bool)> callback, | 1597 base::Callback<void(bool)> callback, |
1580 bool allow) { | 1598 bool allow) { |
1581 // Record access to file system for potential display in UI. | 1599 // Record access to file system for potential display in UI. |
1582 std::vector<std::pair<int, int> >::const_iterator i; | 1600 std::vector<std::pair<int, int> >::const_iterator i; |
1583 for (i = render_frames.begin(); i != render_frames.end(); ++i) { | 1601 for (i = render_frames.begin(); i != render_frames.end(); ++i) { |
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2587 switches::kDisableWebRtcEncryption, | 2605 switches::kDisableWebRtcEncryption, |
2588 }; | 2606 }; |
2589 to_command_line->CopySwitchesFrom(from_command_line, | 2607 to_command_line->CopySwitchesFrom(from_command_line, |
2590 kWebRtcDevSwitchNames, | 2608 kWebRtcDevSwitchNames, |
2591 arraysize(kWebRtcDevSwitchNames)); | 2609 arraysize(kWebRtcDevSwitchNames)); |
2592 } | 2610 } |
2593 } | 2611 } |
2594 #endif // defined(ENABLE_WEBRTC) | 2612 #endif // defined(ENABLE_WEBRTC) |
2595 | 2613 |
2596 } // namespace chrome | 2614 } // namespace chrome |
OLD | NEW |