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

Side by Side Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 5574001: Move ContentSettingsDetails and Pattern out of HostContentSettingsMap as separate classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser/content_settings
Patch Set: updates Created 10 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698