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/ui/webui/extensions/command_handler.cc

Issue 10626007: Move ExtensionSystem into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Master merge; moved class declaration Created 8 years, 5 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/ui/webui/extensions/command_handler.h" 5 #include "chrome/browser/ui/webui/extensions/command_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/extensions/api/commands/command_service.h" 9 #include "chrome/browser/extensions/api/commands/command_service.h"
10 #include "chrome/browser/extensions/api/commands/command_service_factory.h" 10 #include "chrome/browser/extensions/api/commands/command_service_factory.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 #endif 92 #endif
93 } 93 }
94 94
95 void CommandHandler::GetAllCommands(base::DictionaryValue* commands) { 95 void CommandHandler::GetAllCommands(base::DictionaryValue* commands) {
96 ListValue* results = new ListValue; 96 ListValue* results = new ListValue;
97 97
98 Profile* profile = Profile::FromWebUI(web_ui()); 98 Profile* profile = Profile::FromWebUI(web_ui());
99 CommandService* command_service = 99 CommandService* command_service =
100 CommandServiceFactory::GetForProfile(profile); 100 CommandServiceFactory::GetForProfile(profile);
101 101
102 const ExtensionSet* extensions = 102 const ExtensionSet* extensions = extensions::ExtensionSystem::Get(profile)->
103 ExtensionSystem::Get(profile)->extension_service()->extensions(); 103 extension_service()->extensions();
104 for (ExtensionSet::const_iterator extension = extensions->begin(); 104 for (ExtensionSet::const_iterator extension = extensions->begin();
105 extension != extensions->end(); ++extension) { 105 extension != extensions->end(); ++extension) {
106 scoped_ptr<DictionaryValue> extension_dict(new DictionaryValue); 106 scoped_ptr<DictionaryValue> extension_dict(new DictionaryValue);
107 extension_dict->SetString("name", (*extension)->name()); 107 extension_dict->SetString("name", (*extension)->name());
108 extension_dict->SetString("id", (*extension)->id()); 108 extension_dict->SetString("id", (*extension)->id());
109 109
110 // Add the keybindings to a list structure. 110 // Add the keybindings to a list structure.
111 scoped_ptr<ListValue> extensions_list(new ListValue()); 111 scoped_ptr<ListValue> extensions_list(new ListValue());
112 112
113 bool active = false; 113 bool active = false;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 if (!extensions_list->empty()) { 146 if (!extensions_list->empty()) {
147 extension_dict->Set("commands", extensions_list.release()); 147 extension_dict->Set("commands", extensions_list.release());
148 results->Append(extension_dict.release()); 148 results->Append(extension_dict.release());
149 } 149 }
150 } 150 }
151 151
152 commands->Set("commands", results); 152 commands->Set("commands", results);
153 } 153 }
154 154
155 } // namespace extensions 155 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.cc ('k') | chrome/browser/ui/webui/extensions/extension_info_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698