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

Side by Side Diff: chrome/browser/dom_ui/options/content_settings_handler.cc

Issue 6269015: Add facility to fix about: and file: links from chrome:// pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more automatic Created 9 years, 11 months 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/dom_ui/options/content_settings_handler.h" 5 #include "chrome/browser/dom_ui/options/content_settings_handler.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 &ContentSettingsHandler::SetAllowThirdPartyCookies)); 590 &ContentSettingsHandler::SetAllowThirdPartyCookies));
591 dom_ui_->RegisterMessageCallback("removeException", 591 dom_ui_->RegisterMessageCallback("removeException",
592 NewCallback(this, 592 NewCallback(this,
593 &ContentSettingsHandler::RemoveException)); 593 &ContentSettingsHandler::RemoveException));
594 dom_ui_->RegisterMessageCallback("setException", 594 dom_ui_->RegisterMessageCallback("setException",
595 NewCallback(this, 595 NewCallback(this,
596 &ContentSettingsHandler::SetException)); 596 &ContentSettingsHandler::SetException));
597 dom_ui_->RegisterMessageCallback("checkExceptionPatternValidity", 597 dom_ui_->RegisterMessageCallback("checkExceptionPatternValidity",
598 NewCallback(this, 598 NewCallback(this,
599 &ContentSettingsHandler::CheckExceptionPatternValidity)); 599 &ContentSettingsHandler::CheckExceptionPatternValidity));
600 dom_ui_->RegisterMessageCallback(
601 "openPluginsTab",
602 NewCallback(this, &ContentSettingsHandler::OpenPluginsTab));
603 } 600 }
604 601
605 void ContentSettingsHandler::SetContentFilter(const ListValue* args) { 602 void ContentSettingsHandler::SetContentFilter(const ListValue* args) {
606 DCHECK_EQ(2U, args->GetSize()); 603 DCHECK_EQ(2U, args->GetSize());
607 std::string group, setting; 604 std::string group, setting;
608 if (!(args->GetString(0, &group) && 605 if (!(args->GetString(0, &group) &&
609 args->GetString(1, &setting))) { 606 args->GetString(1, &setting))) {
610 NOTREACHED(); 607 NOTREACHED();
611 return; 608 return;
612 } 609 }
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 scoped_ptr<Value> pattern_value(Value::CreateStringValue(pattern_string)); 735 scoped_ptr<Value> pattern_value(Value::CreateStringValue(pattern_string));
739 scoped_ptr<Value> valid_value(Value::CreateBooleanValue(pattern.IsValid())); 736 scoped_ptr<Value> valid_value(Value::CreateBooleanValue(pattern.IsValid()));
740 737
741 dom_ui_->CallJavascriptFunction( 738 dom_ui_->CallJavascriptFunction(
742 L"ContentSettings.patternValidityCheckComplete", *type, 739 L"ContentSettings.patternValidityCheckComplete", *type,
743 *mode_value.get(), 740 *mode_value.get(),
744 *pattern_value.get(), 741 *pattern_value.get(),
745 *valid_value.get()); 742 *valid_value.get());
746 } 743 }
747 744
748 void ContentSettingsHandler::OpenPluginsTab(const ListValue* args) {
749 BrowserList::GetLastActive()->OpenPluginsTabAndActivate();
750 }
751
752 // static 745 // static
753 std::string ContentSettingsHandler::ContentSettingsTypeToGroupName( 746 std::string ContentSettingsHandler::ContentSettingsTypeToGroupName(
754 ContentSettingsType type) { 747 ContentSettingsType type) {
755 switch (type) { 748 switch (type) {
756 case CONTENT_SETTINGS_TYPE_COOKIES: 749 case CONTENT_SETTINGS_TYPE_COOKIES:
757 return "cookies"; 750 return "cookies";
758 case CONTENT_SETTINGS_TYPE_IMAGES: 751 case CONTENT_SETTINGS_TYPE_IMAGES:
759 return "images"; 752 return "images";
760 case CONTENT_SETTINGS_TYPE_JAVASCRIPT: 753 case CONTENT_SETTINGS_TYPE_JAVASCRIPT:
761 return "javascript"; 754 return "javascript";
(...skipping 16 matching lines...) Expand all
778 return dom_ui_->GetProfile()->GetHostContentSettingsMap(); 771 return dom_ui_->GetProfile()->GetHostContentSettingsMap();
779 } 772 }
780 773
781 HostContentSettingsMap* 774 HostContentSettingsMap*
782 ContentSettingsHandler::GetOTRContentSettingsMap() { 775 ContentSettingsHandler::GetOTRContentSettingsMap() {
783 Profile* profile = dom_ui_->GetProfile(); 776 Profile* profile = dom_ui_->GetProfile();
784 if (profile->HasOffTheRecordProfile()) 777 if (profile->HasOffTheRecordProfile())
785 return profile->GetOffTheRecordProfile()->GetHostContentSettingsMap(); 778 return profile->GetOffTheRecordProfile()->GetHostContentSettingsMap();
786 return NULL; 779 return NULL;
787 } 780 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/options/content_settings_handler.h ('k') | chrome/browser/dom_ui/options/options_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698