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

Side by Side Diff: chrome/browser/ui/webui/settings/site_settings_handler.cc

Issue 1758013002: WebUI: Allow rejecting a promise that is returned from cr.sendWithPromise(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-rename Created 4 years, 9 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/settings/site_settings_handler.h" 5 #include "chrome/browser/ui/webui/settings/site_settings_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" 9 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h"
10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 HostContentSettingsMapFactory::GetForProfile(profile_); 138 HostContentSettingsMapFactory::GetForProfile(profile_);
139 ContentSetting setting = map->GetDefaultContentSetting(content_type, nullptr); 139 ContentSetting setting = map->GetDefaultContentSetting(content_type, nullptr);
140 140
141 // FullScreen is Allow vs. Ask. 141 // FullScreen is Allow vs. Ask.
142 bool enabled; 142 bool enabled;
143 if (content_type == CONTENT_SETTINGS_TYPE_FULLSCREEN) 143 if (content_type == CONTENT_SETTINGS_TYPE_FULLSCREEN)
144 enabled = setting != CONTENT_SETTING_ASK; 144 enabled = setting != CONTENT_SETTING_ASK;
145 else 145 else
146 enabled = setting != CONTENT_SETTING_BLOCK; 146 enabled = setting != CONTENT_SETTING_BLOCK;
147 147
148 CallJavascriptCallback(*callback_id, base::FundamentalValue(enabled)); 148 ResolveJavascriptCallback(*callback_id, base::FundamentalValue(enabled));
149 } 149 }
150 150
151 } // namespace settings 151 } // namespace settings
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/settings/search_engines_handler.cc ('k') | chrome/test/data/webui/promise_resolver.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698