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

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

Issue 2820823005: Revert of Stop passing raw pointers to base::Value API in c/b/ui (Closed)
Patch Set: Created 3 years, 8 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/search_engines_handler.h" 5 #include "chrome/browser/ui/webui/settings/search_engines_handler.h"
6 6
7 #include <utility>
8
9 #include "base/bind.h" 7 #include "base/bind.h"
10 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
11 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
12 #include "base/metrics/user_metrics.h" 10 #include "base/metrics/user_metrics.h"
13 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
14 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
15 #include "base/values.h" 13 #include "base/values.h"
16 #include "chrome/browser/extensions/extension_util.h" 14 #include "chrome/browser/extensions/extension_util.h"
17 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/search/hotword_audio_history_handler.h" 16 #include "chrome/browser/search/hotword_audio_history_handler.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 extensions::ExtensionRegistry::Get(profile)->GetExtensionById( 255 extensions::ExtensionRegistry::Get(profile)->GetExtensionById(
258 template_url->GetExtensionId(), 256 template_url->GetExtensionId(),
259 extensions::ExtensionRegistry::EVERYTHING); 257 extensions::ExtensionRegistry::EVERYTHING);
260 if (extension) { 258 if (extension) {
261 std::unique_ptr<base::DictionaryValue> ext_info = 259 std::unique_ptr<base::DictionaryValue> ext_info =
262 extensions::util::GetExtensionInfo(extension); 260 extensions::util::GetExtensionInfo(extension);
263 ext_info->SetBoolean("canBeDisabled", 261 ext_info->SetBoolean("canBeDisabled",
264 !extensions::ExtensionSystem::Get(profile) 262 !extensions::ExtensionSystem::Get(profile)
265 ->management_policy() 263 ->management_policy()
266 ->MustRemainEnabled(extension, nullptr)); 264 ->MustRemainEnabled(extension, nullptr));
267 dict->Set("extension", std::move(ext_info)); 265 dict->Set("extension", ext_info.release());
268 } 266 }
269 } 267 }
270 return dict; 268 return dict;
271 } 269 }
272 270
273 void SearchEnginesHandler::HandleGetSearchEnginesList( 271 void SearchEnginesHandler::HandleGetSearchEnginesList(
274 const base::ListValue* args) { 272 const base::ListValue* args) {
275 CHECK_EQ(1U, args->GetSize()); 273 CHECK_EQ(1U, args->GetSize());
276 const base::Value* callback_id; 274 const base::Value* callback_id;
277 CHECK(args->Get(0, &callback_id)); 275 CHECK(args->Get(0, &callback_id));
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 bool logging_enabled = 553 bool logging_enabled =
556 profile_->GetPrefs()->GetBoolean(prefs::kHotwordAudioLoggingEnabled); 554 profile_->GetPrefs()->GetBoolean(prefs::kHotwordAudioLoggingEnabled);
557 launch_mode = logging_enabled ? HotwordService::HOTWORD_ONLY 555 launch_mode = logging_enabled ? HotwordService::HOTWORD_ONLY
558 : HotwordService::HOTWORD_AND_AUDIO_HISTORY; 556 : HotwordService::HOTWORD_AND_AUDIO_HISTORY;
559 } 557 }
560 hotword_service->OptIntoHotwording(launch_mode); 558 hotword_service->OptIntoHotwording(launch_mode);
561 SendHotwordInfo(); 559 SendHotwordInfo();
562 } 560 }
563 561
564 } // namespace settings 562 } // namespace settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698