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

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

Issue 179243002: Change ProfileKeyedAPIFactory to build instances with BrowserContext instead of Profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
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/commands.h" 5 #include "chrome/browser/extensions/api/commands/commands.h"
6 6
7 #include "chrome/browser/extensions/api/commands/command_service.h" 7 #include "chrome/browser/extensions/api/commands/command_service.h"
8 #include "chrome/browser/profiles/profile.h"
8 9
9 namespace { 10 namespace {
10 11
11 base::DictionaryValue* CreateCommandValue( 12 base::DictionaryValue* CreateCommandValue(
12 const extensions::Command& command, bool active) { 13 const extensions::Command& command, bool active) {
13 base::DictionaryValue* result = new base::DictionaryValue(); 14 base::DictionaryValue* result = new base::DictionaryValue();
14 result->SetString("name", command.command_name()); 15 result->SetString("name", command.command_name());
15 result->SetString("description", command.description()); 16 result->SetString("description", command.description());
16 result->SetString("shortcut", 17 result->SetString("shortcut",
17 active ? command.accelerator().GetShortcutText() : 18 active ? command.accelerator().GetShortcutText() :
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 extension_->id(), iter->second.command_name()); 57 extension_->id(), iter->second.command_name());
57 ui::Accelerator shortcut_assigned = command.accelerator(); 58 ui::Accelerator shortcut_assigned = command.accelerator();
58 active = (shortcut_assigned.key_code() != ui::VKEY_UNKNOWN); 59 active = (shortcut_assigned.key_code() != ui::VKEY_UNKNOWN);
59 60
60 command_list->Append(CreateCommandValue(iter->second, active)); 61 command_list->Append(CreateCommandValue(iter->second, active));
61 } 62 }
62 63
63 SetResult(command_list); 64 SetResult(command_list);
64 return true; 65 return true;
65 } 66 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698