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

Side by Side Diff: chrome/browser/extensions/api/commands/command_service.cc

Issue 22885002: c/b/extensions, json_schema_compiler: Do not use Value::Create*. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Removed C-style casts. Created 7 years, 4 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/extensions/api/commands/command_service.h" 5 #include "chrome/browser/extensions/api/commands/command_service.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 25 matching lines...) Expand all
36 36
37 std::string GetPlatformKeybindingKeyForAccelerator( 37 std::string GetPlatformKeybindingKeyForAccelerator(
38 const ui::Accelerator& accelerator) { 38 const ui::Accelerator& accelerator) {
39 return extensions::Command::CommandPlatform() + ":" + 39 return extensions::Command::CommandPlatform() + ":" +
40 extensions::Command::AcceleratorToString(accelerator); 40 extensions::Command::AcceleratorToString(accelerator);
41 } 41 }
42 42
43 void SetInitialBindingsHaveBeenAssigned( 43 void SetInitialBindingsHaveBeenAssigned(
44 ExtensionPrefs* prefs, const std::string& extension_id) { 44 ExtensionPrefs* prefs, const std::string& extension_id) {
45 prefs->UpdateExtensionPref(extension_id, kInitialBindingsHaveBeenAssigned, 45 prefs->UpdateExtensionPref(extension_id, kInitialBindingsHaveBeenAssigned,
46 base::Value::CreateBooleanValue(true)); 46 new base::FundamentalValue(true));
47 } 47 }
48 48
49 bool InitialBindingsHaveBeenAssigned( 49 bool InitialBindingsHaveBeenAssigned(
50 const ExtensionPrefs* prefs, const std::string& extension_id) { 50 const ExtensionPrefs* prefs, const std::string& extension_id) {
51 bool assigned = false; 51 bool assigned = false;
52 if (!prefs || !prefs->ReadPrefAsBoolean(extension_id, 52 if (!prefs || !prefs->ReadPrefAsBoolean(extension_id,
53 kInitialBindingsHaveBeenAssigned, 53 kInitialBindingsHaveBeenAssigned,
54 &assigned)) 54 &assigned))
55 return false; 55 return false;
56 56
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 return false; 397 return false;
398 398
399 *command = *requested_command; 399 *command = *requested_command;
400 if (shortcut_assigned.key_code() != ui::VKEY_UNKNOWN) 400 if (shortcut_assigned.key_code() != ui::VKEY_UNKNOWN)
401 command->set_accelerator(shortcut_assigned); 401 command->set_accelerator(shortcut_assigned);
402 402
403 return true; 403 return true;
404 } 404 }
405 405
406 } // namespace extensions 406 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698