| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/automation/testing_automation_provider.h" | 5 #include "chrome/browser/automation/testing_automation_provider.h" |
| 6 | 6 |
| 7 #include "app/message_box_flags.h" | 7 #include "app/message_box_flags.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 4479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4490 ContentSetting setting, | 4490 ContentSetting setting, |
| 4491 bool* success) { | 4491 bool* success) { |
| 4492 *success = false; | 4492 *success = false; |
| 4493 if (browser_tracker_->ContainsHandle(handle)) { | 4493 if (browser_tracker_->ContainsHandle(handle)) { |
| 4494 Browser* browser = browser_tracker_->GetResource(handle); | 4494 Browser* browser = browser_tracker_->GetResource(handle); |
| 4495 HostContentSettingsMap* map = | 4495 HostContentSettingsMap* map = |
| 4496 browser->profile()->GetHostContentSettingsMap(); | 4496 browser->profile()->GetHostContentSettingsMap(); |
| 4497 if (host.empty()) { | 4497 if (host.empty()) { |
| 4498 map->SetDefaultContentSetting(content_type, setting); | 4498 map->SetDefaultContentSetting(content_type, setting); |
| 4499 } else { | 4499 } else { |
| 4500 map->SetContentSetting(HostContentSettingsMap::Pattern(host), | 4500 map->SetContentSetting(ContentSettingsPattern(host), |
| 4501 content_type, "", setting); | 4501 content_type, "", setting); |
| 4502 } | 4502 } |
| 4503 *success = true; | 4503 *success = true; |
| 4504 } | 4504 } |
| 4505 } | 4505 } |
| 4506 | 4506 |
| 4507 void TestingAutomationProvider::LoadBlockedPlugins(int tab_handle, | 4507 void TestingAutomationProvider::LoadBlockedPlugins(int tab_handle, |
| 4508 bool* success) { | 4508 bool* success) { |
| 4509 *success = false; | 4509 *success = false; |
| 4510 if (tab_tracker_->ContainsHandle(tab_handle)) { | 4510 if (tab_tracker_->ContainsHandle(tab_handle)) { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4568 DCHECK(type == NotificationType::SESSION_END); | 4568 DCHECK(type == NotificationType::SESSION_END); |
| 4569 // OnBrowserRemoved does a ReleaseLater. When session end is received we exit | 4569 // OnBrowserRemoved does a ReleaseLater. When session end is received we exit |
| 4570 // before the task runs resulting in this object not being deleted. This | 4570 // before the task runs resulting in this object not being deleted. This |
| 4571 // Release balance out the Release scheduled by OnBrowserRemoved. | 4571 // Release balance out the Release scheduled by OnBrowserRemoved. |
| 4572 Release(); | 4572 Release(); |
| 4573 } | 4573 } |
| 4574 | 4574 |
| 4575 void TestingAutomationProvider::OnRemoveProvider() { | 4575 void TestingAutomationProvider::OnRemoveProvider() { |
| 4576 AutomationProviderList::GetInstance()->RemoveProvider(this); | 4576 AutomationProviderList::GetInstance()->RemoveProvider(this); |
| 4577 } | 4577 } |
| OLD | NEW |