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

Side by Side Diff: chrome/browser/ui/webui/settings/appearance_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: nit 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 (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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/appearance_handler.h" 5 #include "chrome/browser/ui/webui/settings/appearance_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 bool is_classic_theme = !is_system_theme && 68 bool is_classic_theme = !is_system_theme &&
69 theme_service->UsingDefaultTheme(); 69 theme_service->UsingDefaultTheme();
70 return base::FundamentalValue(!is_classic_theme); 70 return base::FundamentalValue(!is_classic_theme);
71 } 71 }
72 72
73 void AppearanceHandler::GetResetThemeEnabled(const base::ListValue* args) { 73 void AppearanceHandler::GetResetThemeEnabled(const base::ListValue* args) {
74 CHECK_EQ(1U, args->GetSize()); 74 CHECK_EQ(1U, args->GetSize());
75 const base::Value* callback_id; 75 const base::Value* callback_id;
76 CHECK(args->Get(0, &callback_id)); 76 CHECK(args->Get(0, &callback_id));
77 77
78 base::FundamentalValue enabled(QueryResetThemeEnabledState()); 78 CallJavascriptCallback(*callback_id, true,
Dan Beam 2016/03/03 19:04:51 this was prettier
dpapad 2016/03/03 19:51:22 Done.
79 CallJavascriptCallback(*callback_id, enabled); 79 base::FundamentalValue(QueryResetThemeEnabledState()));
80 } 80 }
81 81
82 } // namespace settings 82 } // namespace settings
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/settings/md_settings_ui.h » ('j') | chrome/browser/ui/webui/settings/md_settings_ui.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698