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

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

Issue 2942043003: Minor fixes to the Chrome Cleanup WebUI (Closed)
Patch Set: Created 3 years, 6 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/resources/settings/chrome_cleanup_page/chrome_cleanup_page.html ('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 (c) 2017 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2017 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/chrome_cleanup_handler.h" 5 #include "chrome/browser/ui/webui/settings/chrome_cleanup_handler.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/feature_list.h" 8 #include "base/feature_list.h"
9 #include "base/synchronization/lock.h" 9 #include "base/synchronization/lock.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 CallJavascriptFunction("cr.webUIListenerCallback", 113 CallJavascriptFunction("cr.webUIListenerCallback",
114 base::Value("chrome-cleanup-on-reboot-required")); 114 base::Value("chrome-cleanup-on-reboot-required"));
115 } 115 }
116 116
117 void ChromeCleanupHandler::HandleDismiss(const base::ListValue* args) { 117 void ChromeCleanupHandler::HandleDismiss(const base::ListValue* args) {
118 DCHECK_EQ(0U, args->GetSize()); 118 DCHECK_EQ(0U, args->GetSize());
119 119
120 controller_->RemoveObserver(this); 120 controller_->RemoveObserver(this);
121 121
122 CallJavascriptFunction("cr.webUIListenerCallback", 122 CallJavascriptFunction("cr.webUIListenerCallback",
123 base::Value("chrome-cleanup-dismiss")); 123 base::Value("chrome-cleanup-on-dismiss"));
124 } 124 }
125 125
126 void ChromeCleanupHandler::HandleRegisterChromeCleanerObserver( 126 void ChromeCleanupHandler::HandleRegisterChromeCleanerObserver(
127 const base::ListValue* args) { 127 const base::ListValue* args) {
128 DCHECK_EQ(0U, args->GetSize()); 128 DCHECK_EQ(0U, args->GetSize());
129 // The Polymer element should never be attached if the feature is 129 // The Polymer element should never be attached if the feature is
130 // disabled. 130 // disabled.
131 DCHECK( 131 DCHECK(
132 base::FeatureList::IsEnabled(safe_browsing::kInBrowserCleanerUIFeature)); 132 base::FeatureList::IsEnabled(safe_browsing::kInBrowserCleanerUIFeature));
133 133
134 AllowJavascript(); 134 AllowJavascript();
135 } 135 }
136 136
137 void ChromeCleanupHandler::HandleRestartComputer(const base::ListValue* args) { 137 void ChromeCleanupHandler::HandleRestartComputer(const base::ListValue* args) {
138 DCHECK_EQ(0U, args->GetSize()); 138 DCHECK_EQ(0U, args->GetSize());
139 139
140 CallJavascriptFunction("cr.webUIListenerCallback", 140 CallJavascriptFunction("cr.webUIListenerCallback",
141 base::Value("chrome-cleanup-on-dismiss")); 141 base::Value("chrome-cleanup-on-dismiss"));
142 // TODO(proberge): Show a prompt to reboot the system. 142 // TODO(proberge): Show a prompt to reboot the system.
143 } 143 }
144 144
145 void ChromeCleanupHandler::HandleStartCleanup(const base::ListValue* args) { 145 void ChromeCleanupHandler::HandleStartCleanup(const base::ListValue* args) {
146 DCHECK_EQ(0U, args->GetSize()); 146 DCHECK_EQ(0U, args->GetSize());
147 147
148 controller_->ReplyWithUserResponse( 148 controller_->ReplyWithUserResponse(
149 ChromeCleanerController::UserResponse::kAccepted); 149 ChromeCleanerController::UserResponse::kAccepted);
150 } 150 }
151 151
152 } // namespace settings 152 } // namespace settings
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698