Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(538)

Unified Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 5254005: Do not reset the content settings delegate's cookies when a network error occurred. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser/tab_contents
Patch Set: updates Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/automation/testing_automation_provider.cc
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc
index ac2622e8869fdd844728ef8de028281ea45ffb98..37956ed3892264a6f79e05e2110ba3b1c8d49ebc 100644
--- a/chrome/browser/automation/testing_automation_provider.cc
+++ b/chrome/browser/automation/testing_automation_provider.cc
@@ -255,6 +255,8 @@ void TestingAutomationProvider::OnMessageReceived(
IPC_MESSAGE_HANDLER(AutomationMsg_GetCookies, GetCookies)
IPC_MESSAGE_HANDLER(AutomationMsg_SetCookie, SetCookie)
IPC_MESSAGE_HANDLER(AutomationMsg_DeleteCookie, DeleteCookie)
+ IPC_MESSAGE_HANDLER(AutomationMsg_IsContentBlocked, IsContentBlocked)
+ IPC_MESSAGE_HANDLER(AutomationMsg_IsContentAccessed, IsContentAccessed)
IPC_MESSAGE_HANDLER(AutomationMsg_ShowCollectedCookiesDialog,
ShowCollectedCookiesDialog)
IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_NavigateToURL, NavigateToURL)
@@ -575,6 +577,34 @@ void TestingAutomationProvider::DeleteCookie(const GURL& url,
}
}
+void TestingAutomationProvider::IsContentBlocked(
+ int handle,
+ ContentSettingsType content_type,
+ bool* is_blocked,
+ bool* success) {
+ *success = false;
+ if (tab_tracker_->ContainsHandle(handle)) {
+ TabSpecificContentSettings* content_settings = tab_tracker_->
+ GetResource(handle)->tab_contents()->GetTabSpecificContentSettings();
+ *is_blocked = content_settings->IsContentBlocked(content_type);
+ *success = true;
+ }
+}
+
+void TestingAutomationProvider::IsContentAccessed(
+ int handle,
+ ContentSettingsType content_type,
+ bool* is_accessed,
+ bool* success) {
+ *success = false;
+ if (tab_tracker_->ContainsHandle(handle)) {
+ TabSpecificContentSettings* content_settings = tab_tracker_->
+ GetResource(handle)->tab_contents()->GetTabSpecificContentSettings();
+ *is_accessed = content_settings->IsContentAccessed(content_type);
+ *success = true;
+ }
+}
+
void TestingAutomationProvider::ShowCollectedCookiesDialog(
int handle, bool* success) {
*success = false;

Powered by Google App Engine
This is Rietveld 408576698