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 <algorithm> | 5 #include <algorithm> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 #include "chrome/browser/ui/browser.h" | 62 #include "chrome/browser/ui/browser.h" |
63 #include "chrome/browser/ui/browser_commands.h" | 63 #include "chrome/browser/ui/browser_commands.h" |
64 #include "chrome/browser/ui/browser_list.h" | 64 #include "chrome/browser/ui/browser_list.h" |
65 #include "chrome/browser/ui/browser_tabstrip.h" | 65 #include "chrome/browser/ui/browser_tabstrip.h" |
66 #include "chrome/browser/ui/browser_window.h" | 66 #include "chrome/browser/ui/browser_window.h" |
67 #include "chrome/browser/ui/host_desktop.h" | 67 #include "chrome/browser/ui/host_desktop.h" |
68 #include "chrome/browser/ui/location_bar/location_bar.h" | 68 #include "chrome/browser/ui/location_bar/location_bar.h" |
69 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" | 69 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" |
70 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 70 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
71 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 71 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 72 #include "chrome/common/chrome_content_settings_client.h" |
72 #include "chrome/common/chrome_paths.h" | 73 #include "chrome/common/chrome_paths.h" |
73 #include "chrome/common/chrome_switches.h" | 74 #include "chrome/common/chrome_switches.h" |
74 #include "chrome/common/content_settings.h" | 75 #include "chrome/common/content_settings.h" |
75 #include "chrome/common/content_settings_pattern.h" | 76 #include "chrome/common/content_settings_pattern.h" |
76 #include "chrome/common/extensions/extension_constants.h" | 77 #include "chrome/common/extensions/extension_constants.h" |
77 #include "chrome/common/pref_names.h" | 78 #include "chrome/common/pref_names.h" |
78 #include "chrome/common/url_constants.h" | 79 #include "chrome/common/url_constants.h" |
79 #include "chrome/test/base/in_process_browser_test.h" | 80 #include "chrome/test/base/in_process_browser_test.h" |
80 #include "chrome/test/base/test_switches.h" | 81 #include "chrome/test/base/test_switches.h" |
81 #include "chrome/test/base/ui_test_utils.h" | 82 #include "chrome/test/base/ui_test_utils.h" |
(...skipping 2839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2921 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kKioskMode); | 2922 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kKioskMode); |
2922 | 2923 |
2923 // Add an entry to the whitelist that allows the specified URL regardless | 2924 // Add an entry to the whitelist that allows the specified URL regardless |
2924 // of the setting of kAudioCapturedAllowed. | 2925 // of the setting of kAudioCapturedAllowed. |
2925 request_url_ = GURL("http://www.example.com/foo"); | 2926 request_url_ = GURL("http://www.example.com/foo"); |
2926 base::ListValue* list = new base::ListValue(); | 2927 base::ListValue* list = new base::ListValue(); |
2927 if (allow_rule) { | 2928 if (allow_rule) { |
2928 list->AppendString(allow_rule); | 2929 list->AppendString(allow_rule); |
2929 request_url_allowed_via_whitelist_ = true; | 2930 request_url_allowed_via_whitelist_ = true; |
2930 } else { | 2931 } else { |
2931 list->AppendString(ContentSettingsPattern::Wildcard().ToString()); | 2932 content_settings::ChromeContentSettingsClient client; |
| 2933 list->AppendString( |
| 2934 ContentSettingsPattern::Wildcard().ToString(&client)); |
2932 // We should ignore all wildcard entries in the whitelist, so even | 2935 // We should ignore all wildcard entries in the whitelist, so even |
2933 // though we've added an entry, it should be ignored and our expectation | 2936 // though we've added an entry, it should be ignored and our expectation |
2934 // is that the request has not been allowed via the whitelist. | 2937 // is that the request has not been allowed via the whitelist. |
2935 request_url_allowed_via_whitelist_ = false; | 2938 request_url_allowed_via_whitelist_ = false; |
2936 } | 2939 } |
2937 policies->Set(whitelist_policy, POLICY_LEVEL_MANDATORY, | 2940 policies->Set(whitelist_policy, POLICY_LEVEL_MANDATORY, |
2938 POLICY_SCOPE_USER, list, NULL); | 2941 POLICY_SCOPE_USER, list, NULL); |
2939 } | 2942 } |
2940 } | 2943 } |
2941 | 2944 |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3213 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( | 3216 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( |
3214 browser2->tab_strip_model()->GetActiveWebContents(), | 3217 browser2->tab_strip_model()->GetActiveWebContents(), |
3215 "domAutomationController.send(window.showModalDialog !== undefined);", | 3218 "domAutomationController.send(window.showModalDialog !== undefined);", |
3216 &result)); | 3219 &result)); |
3217 EXPECT_TRUE(result); | 3220 EXPECT_TRUE(result); |
3218 } | 3221 } |
3219 | 3222 |
3220 #endif // !defined(CHROME_OS) | 3223 #endif // !defined(CHROME_OS) |
3221 | 3224 |
3222 } // namespace policy | 3225 } // namespace policy |
OLD | NEW |