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/extensions/api/management/management_api.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/management/management_api.h" 5 #include "chrome/browser/extensions/api/management/management_api.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 break; 671 break;
672 default: 672 default:
673 NOTREACHED(); 673 NOTREACHED();
674 return; 674 return;
675 } 675 }
676 DCHECK(event_name); 676 DCHECK(event_name);
677 DCHECK(extension); 677 DCHECK(extension);
678 678
679 scoped_ptr<base::ListValue> args(new base::ListValue()); 679 scoped_ptr<base::ListValue> args(new base::ListValue());
680 if (event_name == events::kOnExtensionUninstalled) { 680 if (event_name == events::kOnExtensionUninstalled) {
681 args->Append(Value::CreateStringValue(extension->id())); 681 args->Append(new base::StringValue(extension->id()));
682 } else { 682 } else {
683 scoped_ptr<management::ExtensionInfo> info = CreateExtensionInfo( 683 scoped_ptr<management::ExtensionInfo> info = CreateExtensionInfo(
684 *extension, ExtensionSystem::Get(profile)); 684 *extension, ExtensionSystem::Get(profile));
685 args->Append(info->ToValue().release()); 685 args->Append(info->ToValue().release());
686 } 686 }
687 687
688 scoped_ptr<Event> event(new Event(event_name, args.Pass())); 688 scoped_ptr<Event> event(new Event(event_name, args.Pass()));
689 ExtensionSystem::Get(profile)->event_router()->BroadcastEvent(event.Pass()); 689 ExtensionSystem::Get(profile)->event_router()->BroadcastEvent(event.Pass());
690 } 690 }
691 691
(...skipping 23 matching lines...) Expand all
715 ProfileKeyedAPIFactory<ManagementAPI>* ManagementAPI::GetFactoryInstance() { 715 ProfileKeyedAPIFactory<ManagementAPI>* ManagementAPI::GetFactoryInstance() {
716 return &g_factory.Get(); 716 return &g_factory.Get();
717 } 717 }
718 718
719 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { 719 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) {
720 management_event_router_.reset(new ManagementEventRouter(profile_)); 720 management_event_router_.reset(new ManagementEventRouter(profile_));
721 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); 721 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this);
722 } 722 }
723 723
724 } // namespace extensions 724 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698