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

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

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

Powered by Google App Engine
This is Rietveld 408576698