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

Side by Side Diff: chrome/browser/ui/webui/options/website_settings_handler.cc

Issue 471763009: Update the Website Settings options page when a Content Setting is used. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « chrome/browser/ui/webui/options/website_settings_handler.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ui/webui/options/website_settings_handler.h" 5 #include "chrome/browser/ui/webui/options/website_settings_handler.h"
6 6
7 #include "apps/app_window_registry.h" 7 #include "apps/app_window_registry.h"
8 #include "chrome/browser/content_settings/content_settings_utils.h" 8 #include "chrome/browser/content_settings/content_settings_utils.h"
9 #include "chrome/browser/content_settings/host_content_settings_map.h" 9 #include "chrome/browser/content_settings/host_content_settings_map.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 // content_settings::Observer implementation. 122 // content_settings::Observer implementation.
123 void WebsiteSettingsHandler::OnContentSettingChanged( 123 void WebsiteSettingsHandler::OnContentSettingChanged(
124 const ContentSettingsPattern& primary_pattern, 124 const ContentSettingsPattern& primary_pattern,
125 const ContentSettingsPattern& secondary_pattern, 125 const ContentSettingsPattern& secondary_pattern,
126 ContentSettingsType content_type, 126 ContentSettingsType content_type,
127 std::string resource_identifier) { 127 std::string resource_identifier) {
128 Update(); 128 Update();
129 } 129 }
130 130
131 void WebsiteSettingsHandler::OnContentSettingUsed(
132 const ContentSettingsPattern& primary_pattern,
133 const ContentSettingsPattern& secondary_pattern,
134 ContentSettingsType content_type) {
135 Update();
136 }
137
131 void WebsiteSettingsHandler::HandleUpdateOrigins(const base::ListValue* args) { 138 void WebsiteSettingsHandler::HandleUpdateOrigins(const base::ListValue* args) {
132 std::string content_setting_name; 139 std::string content_setting_name;
133 bool rv = args->GetString(0, &content_setting_name); 140 bool rv = args->GetString(0, &content_setting_name);
134 DCHECK(rv); 141 DCHECK(rv);
135 142
136 ContentSettingsType content_type; 143 ContentSettingsType content_type;
137 rv = content_settings::GetTypeFromName(content_setting_name, &content_type); 144 rv = content_settings::GetTypeFromName(content_setting_name, &content_type);
138 DCHECK(rv); 145 DCHECK(rv);
139 DCHECK_NE( 146 DCHECK_NE(
140 kValidTypes + kValidTypesLength, 147 kValidTypes + kValidTypesLength,
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 506
500 // Load a new BrowsingDataLocalStorageHelper to update. 507 // Load a new BrowsingDataLocalStorageHelper to update.
501 local_storage_ = new BrowsingDataLocalStorageHelper(profile); 508 local_storage_ = new BrowsingDataLocalStorageHelper(profile);
502 509
503 local_storage_->StartFetching( 510 local_storage_->StartFetching(
504 base::Bind(&WebsiteSettingsHandler::OnLocalStorageFetched, 511 base::Bind(&WebsiteSettingsHandler::OnLocalStorageFetched,
505 weak_ptr_factory_.GetWeakPtr())); 512 weak_ptr_factory_.GetWeakPtr()));
506 } 513 }
507 514
508 } // namespace options 515 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/website_settings_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698