diff options
author | joaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-12 16:04:06 +0000 |
---|---|---|
committer | joaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-12 16:04:06 +0000 |
commit | 730cab380c7b1bbcac8b3a25d1278992d840eb9b (patch) | |
tree | 7cdcbbda287b81893be06f88649e5d4c45d49b88 | |
parent | bf5931c66d69deebf9d7a7dabc7bb7e5ce567050 (diff) | |
download | chromium_src-730cab380c7b1bbcac8b3a25d1278992d840eb9b.zip chromium_src-730cab380c7b1bbcac8b3a25d1278992d840eb9b.tar.gz chromium_src-730cab380c7b1bbcac8b3a25d1278992d840eb9b.tar.bz2 |
Relanding https://chromiumcodereview.appspot.com/10694037 after a revert. The original CL failed on Mac Debug.
Add a policy to disable proceeding through the Safe Browsing interstitials.
BUG=119184
TEST=browser_tests:SafeBrowsingBlockingPageTest.*, Safe Browsing warning pages don't have a "proceed" link when opening malware sites (e.g. ianfette.org) and the policy is set
Review URL: https://chromiumcodereview.appspot.com/10690102
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146359 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/app/policy/policy_templates.json | 20 | ||||
-rw-r--r-- | chrome/browser/policy/configuration_policy_handler_list.cc | 3 | ||||
-rw-r--r-- | chrome/browser/profiles/profile.cc | 3 | ||||
-rw-r--r-- | chrome/browser/resources/safe_browsing_malware_block.html | 23 | ||||
-rw-r--r-- | chrome/browser/resources/safe_browsing_multiple_threat_block.html | 63 | ||||
-rw-r--r-- | chrome/browser/resources/safe_browsing_phishing_block.html | 26 | ||||
-rw-r--r-- | chrome/browser/safe_browsing/safe_browsing_blocking_page.cc | 49 | ||||
-rw-r--r-- | chrome/browser/safe_browsing/safe_browsing_blocking_page.h | 4 | ||||
-rw-r--r-- | chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc | 60 | ||||
-rw-r--r-- | chrome/common/pref_names.cc | 5 | ||||
-rw-r--r-- | chrome/common/pref_names.h | 1 | ||||
-rwxr-xr-x | chrome/test/functional/policy_test_cases.py | 2 | ||||
-rw-r--r-- | chrome/tools/chromeactions.txt | 3 | ||||
-rwxr-xr-x | chrome/tools/extract_actions.py | 4 |
14 files changed, 203 insertions, 63 deletions
diff --git a/chrome/app/policy/policy_templates.json b/chrome/app/policy/policy_templates.json index fd9e75e..1699e20 100644 --- a/chrome/app/policy/policy_templates.json +++ b/chrome/app/policy/policy_templates.json @@ -112,7 +112,7 @@ # persistent IDs for all fields (but not for groups!) are needed. These are # specified by the 'id' keys of each policy. NEVER CHANGE EXISTING IDs, # because doing so would break the deployed wire format! -# For your editing convenience: highest ID currently used: 149 +# For your editing convenience: highest ID currently used: 150 # # Placeholders: # The following placeholder strings are automatically substituted: @@ -2728,9 +2728,7 @@ 'name': 'RestrictSigninToPattern', 'type': 'string', 'supported_on': ['chrome.*:21-'], - 'features': { - 'dynamic_refresh': True, - }, + 'features': {'dynamic_refresh': True}, 'example_value': '*@domain.com', 'id': 147, 'caption': '''Restrict which users are allowed to sign in to <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.''', @@ -2740,6 +2738,20 @@ If this policy is left not set or blank, then any user can sign in to <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.''', }, + { + 'name': 'DisableSafeBrowsingProceedAnyway', + 'type': 'main', + 'supported_on': ['chrome.*:22-', 'chrome_os:0.22-'], + 'features': {'dynamic_refresh': True}, + 'example_value': True, + 'id': 150, + 'caption': '''Disable proceeding from the Safe Browsing warning page''', + 'desc': '''Disable proceeding from the Safe Browsing warning page. + + The Safe Browsing service shows a warning page when users navigate to sites that are flagged as potentially mallicious. Enabling this setting prevents users from proceeding anyway from the warning page to the malicious site. + + If this setting is disabled or not configured then users can choose to proceed to the flagged site after being shown the warning.''', + }, ], 'messages': { # Messages that are not associated to any policies. diff --git a/chrome/browser/policy/configuration_policy_handler_list.cc b/chrome/browser/policy/configuration_policy_handler_list.cc index 5d4b2f4..c5c4938c 100644 --- a/chrome/browser/policy/configuration_policy_handler_list.cc +++ b/chrome/browser/policy/configuration_policy_handler_list.cc @@ -285,6 +285,9 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = { { key::kDefaultMediaStreamSetting, prefs::kManagedDefaultMediaStreamSetting, Value::TYPE_INTEGER }, + { key::kDisableSafeBrowsingProceedAnyway, + prefs::kSafeBrowsingProceedAnywayDisabled, + Value::TYPE_BOOLEAN }, #if defined(OS_CHROMEOS) { key::kChromeOsLockOnIdleSuspend, diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc index 5e627e9..ed4b2c4 100644 --- a/chrome/browser/profiles/profile.cc +++ b/chrome/browser/profiles/profile.cc @@ -60,6 +60,9 @@ void Profile::RegisterUserPrefs(PrefService* prefs) { prefs->RegisterBooleanPref(prefs::kSafeBrowsingReportingEnabled, false, PrefService::UNSYNCABLE_PREF); + prefs->RegisterBooleanPref(prefs::kSafeBrowsingProceedAnywayDisabled, + false, + PrefService::UNSYNCABLE_PREF); prefs->RegisterBooleanPref(prefs::kDisableExtensions, false, PrefService::UNSYNCABLE_PREF); diff --git a/chrome/browser/resources/safe_browsing_malware_block.html b/chrome/browser/resources/safe_browsing_malware_block.html index 56f4eca..aa71348 100644 --- a/chrome/browser/resources/safe_browsing_malware_block.html +++ b/chrome/browser/resources/safe_browsing_malware_block.html @@ -143,29 +143,38 @@ label.checkbox > span { </head> <body oncontextmenu="return false;"> -<div class="background"><img src="ssl_roadblock_background.png" width="100%" height="100%" alt="background" onmousedown="return false;"/></div> +<div class="background"> + <img src="ssl_roadblock_background.png" width="100%" height="100%" + alt="background" onmousedown="return false;"> +</div> <table width="100%" cellspacing="0" cellpadding="0"> <td class="cell" valign="middle" align="center"> <div class="box"> - <div class="icon"><img src="shared/images/phishing_icon.png" alt="Malware Icon" onmousedown="return false;"/></div> + <div class="icon"> + <img src="shared/images/phishing_icon.png" alt="Malware Icon" + onmousedown="return false;"> + </div> <div class="title" i18n-content="headLine"></div> <div class="main" i18n-values=".innerHTML:description1"></div> <div class="main" i18n-values=".innerHTML:description2"></div> - <div class="main" i18n-values=".innerHTML:description5" id="detailinfo" style="display:block"></div> + <div id="detailinfo" class="main" i18n-values=".innerHTML:description5"> + </div> <div class="main"> <form class="submission"> - <input type="button" class="green" id="back" i18n-values="value:back_button" onclick="sendCommand('takeMeBack')"> + <button id="back" class="green" i18n-content="back_button" + onclick="sendCommand('takeMeBack')"></button> <br> </form> </div> - <div class="main" i18n-values=".innerHTML:description3"></div> + <div class="main" i18n-values=".innerHTML:description3" + jsdisplay="!proceedDisabled"></div> <div class="main footer" jsdisplay="displaycheckbox"> <label class="checkbox" for="checkreport"> - <input name="checked" id="checkreport" type="checkbox" - jsvalues=".checked:boxchecked" onclick="savePreference()"> + <input id="checkreport" name="checked" type="checkbox" + jsvalues=".checked:boxchecked" onclick="savePreference()"> <span i18n-values=".innerHTML:confirm_text"></span> </label> </div> diff --git a/chrome/browser/resources/safe_browsing_multiple_threat_block.html b/chrome/browser/resources/safe_browsing_multiple_threat_block.html index 40dd0c4..100b8c1 100644 --- a/chrome/browser/resources/safe_browsing_multiple_threat_block.html +++ b/chrome/browser/resources/safe_browsing_multiple_threat_block.html @@ -1,5 +1,5 @@ <!DOCTYPE html> -<html> +<html id="template_root"> <head> <title i18n-content="title"></title> <style> @@ -87,53 +87,76 @@ function sendCommand(command) { window.domAutomationController.send(command); } -function showDiagnostic(errorID) { - sendCommand("showDiagnostic:" + errorID); -} - -function reportError(errorID) { - sendCommand("reportError:" + errorID); -} - function learnMore() { - sendCommand("learnMore"); + sendCommand('learnMore'); } function proceed() { - sendCommand("proceed"); + sendCommand('proceed'); } function takeMeBack() { - sendCommand("takeMeBack"); + sendCommand('takeMeBack'); +} + +/** + * Called when the user clicks the link to show the diagnostic or report a + * malware site, depending on the threat type. + * @param {MouseEvent} event The mouse event that triggered this call. + */ +function showOrReport(event) { + var id = event.currentTarget.getAttribute('chromiumID'); + var isMalware = event.currentTarget.getAttribute('chromiumIsMalware'); + var cmd = isMalware ? 'showDiagnostic:' : 'reportError:'; + sendCommand(cmd + id); + return false; } </script> </head> <body oncontextmenu="return false;"> -<div class="background"><img src="ssl_roadblock_background.png" width="100%" height="100%" alt="background" onmousedown="return false;"/></div> +<div class="background"> + <img src="ssl_roadblock_background.png" width="100%" height="100%" + alt="background" onmousedown="return false;"> +</div> <table width="100%" cellspacing="0" cellpadding="0"> <td class="cell" valign="middle" align="center"> <div class="box"> - <div class="icon"><img src="shared/images/phishing_icon.png" alt="Malware Icon" onmousedown="return false;"/></div> + <div class="icon"> + <img src="shared/images/phishing_icon.png" alt="Malware Icon" + onmousedown="return false;"> + </div> <div class="title" i18n-content="headLine"></div> <div class="main" i18n-values=".innerHTML:description1"></div> <div class="main" i18n-content="description2"></div> - <div class="main" id="template_root"> + <div class="main"> <table cellpadding="5" jsvalues="$counter:{value: 0}"> <tr jsselect="errors" class="errorlist"> <td jscontent="typeLabel"></td> <td jscontent="url"></td> - <td><a href="" onclick="var id= this.getAttribute('chromiumID'); this.getAttribute('chromiumIsMalware') ? showDiagnostic(id) : reportError(id); return false;" jscontent="errorLink" jsvalues="chromiumID:$counter.value;chromiumIsMalware:type=='malware'" jseval="$counter.value++"></a></td> + <td><a href="" onclick="showOrReport(event)" + jsvalues="chromiumID:$counter.value;chromiumIsMalware:type=='malware'" + jscontent="errorLink" jseval="$counter.value++"></a></td> </tr> </table> </div> - <div class="main"><a href="" i18n-content="description3" onclick="learnMore(); return false;" onmousedown="return false;"></a></div> + <div class="main"> + <a href="" i18n-content="description3" onmousedown="return false;" + onclick="learnMore(); return false;"></a> + </div> <div class="main"> <form class="submission"> - <input name="checky" id="checky" type="checkbox" onclick="agreed(this.form)"> <label for="checky" i18n-content="confirm_text"></label> - <input type="button" name="continue_button" i18n-values="value:continue_button" disabled="true" onclick="proceed();"><br> - <input type="button" name="back_button" i18n-values="value:back_button" onclick="takeMeBack()"> + <input id="checky" name="checky" type="checkbox" + jsdisplay="!proceedDisabled" + onclick="agreed(this.form)"> + <label for="checky" i18n-content="confirm_text" + jsdisplay="!proceedDisabled"></label> + <button name="continue_button" i18n-content="continue_button" + disabled="true" jsdisplay="!proceedDisabled" + onclick="proceed();"></button><br> + <button name="back_button" i18n-content="back_button" + onclick="takeMeBack()"></button> </form> </div> </div> diff --git a/chrome/browser/resources/safe_browsing_phishing_block.html b/chrome/browser/resources/safe_browsing_phishing_block.html index b39e95c..62880b5 100644 --- a/chrome/browser/resources/safe_browsing_phishing_block.html +++ b/chrome/browser/resources/safe_browsing_phishing_block.html @@ -114,21 +114,35 @@ html[dir='rtl'] .helpbutton { </head> <body oncontextmenu="return false;"> -<div class="background"><img src="ssl_roadblock_background.png" width="100%" height="100%" alt="background" onmousedown="return false;"></div> +<div class="background"> + <img src="ssl_roadblock_background.png" width="100%" height="100%" + alt="background" onmousedown="return false;"> +</div> <table width="100%" cellspacing="0" cellpadding="0"> <td class="cell" valign="middle" align="center"> <div class="box"> - <div class="icon"><img src="shared/images/phishing_icon.png" alt="Phishing Warning Icon" onmousedown="return false;"></div> + <div class="icon"> + <img src="shared/images/phishing_icon.png" alt="Phishing Warning Icon" + onmousedown="return false;"> + </div> <div class="title" i18n-content="headLine"></div> <div class="main" i18n-values=".innerHTML:description1"></div> <div class="main"> <form class="submission"> - <input type="button" class="green" id="back" i18n-values="value:back_button" onclick="sendCommand('takeMeBack')"> + <button id="back" class="green" i18n-content="back_button" + onclick="sendCommand('takeMeBack')"></button> </form> </div> - <div class="main"><a href="" i18n-content="description2" onclick="sendCommand('learnMore'); return false;"></a></div> - <div class="main"><a href="" onclick="sendCommand('reportError'); return false;" onmousedown="return false;" i18n-content="report_error"></a></div> - <div class="main" i18n-values=".innerHTML:description3"></div> + <div class="main"> + <a href="" i18n-content="description2" + onclick="sendCommand('learnMore'); return false;"></a> + </div> + <div class="main"> + <a href="" onclick="sendCommand('reportError'); return false;" + onmousedown="return false;" i18n-content="report_error"></a> + </div> + <div class="main" i18n-values=".innerHTML:description3" + jsdisplay="!proceedDisabled"></div> </div> </td> </table> diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc index 2cc7f5b..4fdc312 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc @@ -240,6 +240,8 @@ void SafeBrowsingBlockingPage::PopulateStringDictionary( strings->SetString("description1", description1); strings->SetString("description2", description2); strings->SetString("description3", description3); + strings->SetBoolean("proceedDisabled", + IsPrefEnabled(prefs::kSafeBrowsingProceedAnywayDisabled)); } void SafeBrowsingBlockingPage::PopulateMultipleThreatStringDictionary( @@ -389,19 +391,10 @@ void SafeBrowsingBlockingPage::PopulateMalwareStringDictionary( l10n_util::GetStringFUTF16( IDS_SAFE_BROWSING_MALWARE_REPORTING_AGREE, UTF8ToUTF16(privacy_link))); - - Profile* profile = Profile::FromBrowserContext( - web_contents_->GetBrowserContext()); - const PrefService::Preference* pref = - profile->GetPrefs()->FindPreference( - prefs::kSafeBrowsingReportingEnabled); - - bool value; - if (pref && pref->GetValue()->GetAsBoolean(&value) && value) { + if (IsPrefEnabled(prefs::kSafeBrowsingReportingEnabled)) strings->SetString(kBoxChecked, "yes"); - } else { + else strings->SetString(kBoxChecked, ""); - } } } @@ -477,18 +470,23 @@ void SafeBrowsingBlockingPage::CommandReceived(const std::string& cmd) { return; } + bool proceed_blocked = false; if (command == kProceedCommand) { - interstitial_page_->Proceed(); - // We are deleted after this. - return; + if (IsPrefEnabled(prefs::kSafeBrowsingProceedAnywayDisabled)) { + proceed_blocked = true; + } else { + interstitial_page_->Proceed(); + // |this| has been deleted after Proceed() returns. + return; + } } - if (command == kTakeMeBackCommand) { + if (command == kTakeMeBackCommand || proceed_blocked) { if (is_main_frame_load_blocked_) { // If the load is blocked, we want to close the interstitial and discard // the pending entry. interstitial_page_->DontProceed(); - // We are deleted after this. + // |this| has been deleted after DontProceed() returns. return; } @@ -678,7 +676,10 @@ void SafeBrowsingBlockingPage::RecordUserAction(BlockingPageEvent event) { action.append("Proceed"); break; case DONT_PROCEED: - action.append("DontProceed"); + if (IsPrefEnabled(prefs::kSafeBrowsingProceedAnywayDisabled)) + action.append("ForcedDontProceed"); + else + action.append("DontProceed"); break; default: NOTREACHED() << "Unexpected event: " << event; @@ -739,13 +740,7 @@ void SafeBrowsingBlockingPage::FinishMalwareDetails(int64 delay_ms) { if (malware_details_ == NULL) return; // Not all interstitials have malware details (eg phishing). - Profile* profile = Profile::FromBrowserContext( - web_contents_->GetBrowserContext()); - const PrefService::Preference* pref = - profile->GetPrefs()->FindPreference(prefs::kSafeBrowsingReportingEnabled); - - bool value; - if (pref && pref->GetValue()->GetAsBoolean(&value) && value) { + if (IsPrefEnabled(prefs::kSafeBrowsingReportingEnabled)) { // Finish the malware details collection, send it over. BrowserThread::PostDelayedTask( BrowserThread::IO, FROM_HERE, @@ -754,6 +749,12 @@ void SafeBrowsingBlockingPage::FinishMalwareDetails(int64 delay_ms) { } } +bool SafeBrowsingBlockingPage::IsPrefEnabled(const char* pref) { + Profile* profile = + Profile::FromBrowserContext(web_contents_->GetBrowserContext()); + return profile->GetPrefs()->GetBoolean(pref); +} + // static void SafeBrowsingBlockingPage::NotifySafeBrowsingService( SafeBrowsingService* sb_service, diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.h b/chrome/browser/safe_browsing/safe_browsing_blocking_page.h index 6910287..0f60da3 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.h +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.h @@ -145,6 +145,10 @@ class SafeBrowsingBlockingPage : public content::InterstitialPageDelegate { // enabled, the report is scheduled to be sent on the |sb_service_|. void FinishMalwareDetails(int64 delay_ms); + // Returns the boolean value of the given |pref| from the PrefService of the + // Profile associated with |web_contents_|. + bool IsPrefEnabled(const char* pref); + // A list of SafeBrowsingService::UnsafeResource for a tab that the user // should be warned about. They are queued when displaying more than one // interstitial at a time. diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc index 394f2c6..2177836 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc @@ -8,6 +8,8 @@ // they work. #include "base/bind.h" +#include "base/utf_string_conversions.h" +#include "base/values.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" @@ -24,6 +26,7 @@ #include "content/public/browser/interstitial_page.h" #include "content/public/browser/navigation_controller.h" #include "content/public/browser/notification_types.h" +#include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_view.h" #include "content/public/test/test_browser_thread.h" @@ -369,6 +372,34 @@ class SafeBrowsingBlockingPageTest : public InProcessBrowserTest { SendCommand("\"proceed\""); } + bool GetProceedLinkIsHidden(bool* result) { + InterstitialPage* interstitial = InterstitialPage::GetInterstitialPage( + chrome::GetActiveWebContents(browser())); + if (!interstitial) + return false; + content::RenderViewHost* rvh = interstitial->GetRenderViewHostForTesting(); + if (!rvh) + return false; + scoped_ptr<base::Value> value(rvh->ExecuteJavascriptAndGetValue( + string16(), + ASCIIToUTF16( + // Make sure jstemplate has processed the page. + // TODO(joaodasilva): it would be better to make sure all the + // <script> tags have executed before injecting more javascript. + "var root = document.getElementById('template_root');\n" + "jstProcess(new JsEvalContext(templateData), root);\n" + // Now inspect the "proceed anyway" <div>. + "var list = document.querySelectorAll(" + " 'div[jsdisplay=\"!proceedDisabled\"]');\n" + "if (list.length == 1)\n" + " list[0].style.display === 'none';\n" + "else\n" + " 'Fail with non-boolean result value';\n"))); + if (!value.get()) + return false; + return value->GetAsBoolean(result); + } + protected: TestMalwareDetailsFactory details_factory_; @@ -406,6 +437,10 @@ IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageTest, MalwareDontProceed) { ui_test_utils::NavigateToURL(browser(), url); + bool hidden = false; + EXPECT_TRUE(GetProceedLinkIsHidden(&hidden)); + EXPECT_FALSE(hidden); + SendCommand("\"takeMeBack\""); // Simulate the user clicking "back" AssertNoInterstitial(false); // Assert the interstitial is gone EXPECT_EQ( @@ -562,3 +597,28 @@ IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageTest, EXPECT_EQ(url, chrome::GetActiveWebContents(browser())->GetURL()); AssertReportSent(); } + +// Verifies that the "proceed anyway" link isn't available when it is disabled +// by the corresponding policy. Also verifies that sending the "proceed" +// command anyway doesn't advance to the malware site. +IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageTest, ProceedDisabled) { + // Simulate a policy disabling the "proceed anyway" link. + browser()->profile()->GetPrefs()->SetBoolean( + prefs::kSafeBrowsingProceedAnywayDisabled, true); + + GURL url = test_server()->GetURL(kEmptyPage); + AddURLResult(url, SafeBrowsingService::URL_MALWARE); + ui_test_utils::NavigateToURL(browser(), url); + + // The "proceed anyway" link should be hidden. + bool hidden = false; + EXPECT_TRUE(GetProceedLinkIsHidden(&hidden)); + EXPECT_TRUE(hidden); + + // The "proceed" command should go back instead, if proceeding is disabled. + SendCommand("\"proceed\""); + AssertNoInterstitial(true); + EXPECT_EQ( + GURL(chrome::kAboutBlankURL), // Back to "about:blank" + chrome::GetActiveWebContents(browser())->GetURL()); +} diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index 511a0ff..2430559 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc @@ -321,6 +321,11 @@ const char kSafeBrowsingEnabled[] = "safebrowsing.enabled"; const char kSafeBrowsingReportingEnabled[] = "safebrowsing.reporting_enabled"; +// Boolean that is true when the SafeBrowsing interstitial should not allow +// users to proceed anyway. +const char kSafeBrowsingProceedAnywayDisabled[] = + "safebrowsing.proceed_anyway_disabled"; + // Enum that specifies whether Incognito mode is: // 0 - Enabled. Default behaviour. Default mode is available on demand. // 1 - Disabled. Used cannot browse pages in Incognito mode. diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index 47be4ef..34eba145 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h @@ -141,6 +141,7 @@ extern const char kAutologinEnabled[]; extern const char kReverseAutologinEnabled[]; extern const char kSafeBrowsingEnabled[]; extern const char kSafeBrowsingReportingEnabled[]; +extern const char kSafeBrowsingProceedAnywayDisabled[]; extern const char kIncognitoModeAvailability[]; extern const char kSearchSuggestEnabled[]; extern const char kConfirmToQuitEnabled[]; diff --git a/chrome/test/functional/policy_test_cases.py b/chrome/test/functional/policy_test_cases.py index fcb61e6..a2883ce 100755 --- a/chrome/test/functional/policy_test_cases.py +++ b/chrome/test/functional/policy_test_cases.py @@ -243,6 +243,8 @@ class PolicyPrefsTestCases(object): ('kBackgroundModeEnabled', True, [BROWSER], ['win', 'linux']), 'RestrictSigninToPattern': ('kGoogleServicesUsernamePattern', '.*@google.com', [], ['win', 'mac', 'linux']), + 'DisableSafeBrowsingProceedAnyway': + ('kSafeBrowsingProceedAnywayDisabled', True, [], OS_ALL), # ChromeOS-only policies: # TODO(frankf): Add prefs for these after crosbug.com/28756 is fixed. diff --git a/chrome/tools/chromeactions.txt b/chrome/tools/chromeactions.txt index 5b09fa0..96177bf 100644 --- a/chrome/tools/chromeactions.txt +++ b/chrome/tools/chromeactions.txt @@ -1126,12 +1126,15 @@ 0xa728f2892204aabc ReportBug 0x8f83bd601e845bc1 RestoreTab 0x665cc78aff3f37f5 SBInterstitialMalwareDontProceed +0xe25978a348044c85 SBInterstitialMalwareForcedDontProceed 0xf02ed35cab0dcf4b SBInterstitialMalwareProceed 0x09af23846e454261 SBInterstitialMalwareShow 0xc81645e63b16cb44 SBInterstitialMultipleDontProceed +0x8dd6ffcec8e73dd6 SBInterstitialMultipleForcedDontProceed 0x866cc35d2bcdf71d SBInterstitialMultipleProceed 0x6dbe9571062fcfde SBInterstitialMultipleShow 0x60578de80374e115 SBInterstitialPhishingDontProceed +0xf3714282bdf38737 SBInterstitialPhishingForcedDontProceed 0x340331e81b86f933 SBInterstitialPhishingProceed 0xf8af4ff865669301 SBInterstitialPhishingShow 0xe1df5f4bee6d0e2f SSL.DisplayedInsecureContent diff --git a/chrome/tools/extract_actions.py b/chrome/tools/extract_actions.py index 8d4cf62..165d23c 100755 --- a/chrome/tools/extract_actions.py +++ b/chrome/tools/extract_actions.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Copyright (c) 2011 The Chromium Authors. All rights reserved. +# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -126,7 +126,7 @@ def AddComputedActions(actions): # Actions for safe_browsing_blocking_page.cc. for interstitial in ('Phishing', 'Malware', 'Multiple'): - for action in ('Show', 'Proceed', 'DontProceed'): + for action in ('Show', 'Proceed', 'DontProceed', 'ForcedDontProceed'): actions.add('SBInterstitial%s%s' % (interstitial, action)) # Actions for language_options_handler.cc (Chrome OS specific). |