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

Side by Side Diff: chrome/browser/extensions/extension_keybinding_registry.cc

Issue 16915006: Convert most of extensions and some other random stuff to using the base namespace for Values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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/extension_keybinding_registry.h" 5 #include "chrome/browser/extensions/extension_keybinding_registry.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/browser/extensions/active_tab_permission_granter.h" 8 #include "chrome/browser/extensions/active_tab_permission_granter.h"
9 #include "chrome/browser/extensions/event_router.h" 9 #include "chrome/browser/extensions/event_router.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 if (!extension) 63 if (!extension)
64 return; 64 return;
65 65
66 // Grant before sending the event so that the permission is granted before 66 // Grant before sending the event so that the permission is granted before
67 // the extension acts on the command. 67 // the extension acts on the command.
68 ActiveTabPermissionGranter* granter = 68 ActiveTabPermissionGranter* granter =
69 delegate_->GetActiveTabPermissionGranter(); 69 delegate_->GetActiveTabPermissionGranter();
70 if (granter) 70 if (granter)
71 granter->GrantIfRequested(extension); 71 granter->GrantIfRequested(extension);
72 72
73 scoped_ptr<ListValue> args(new ListValue()); 73 scoped_ptr<base::ListValue> args(new base::ListValue());
74 args->Append(Value::CreateStringValue(command)); 74 args->Append(Value::CreateStringValue(command));
75 75
76 scoped_ptr<Event> event(new Event("commands.onCommand", args.Pass())); 76 scoped_ptr<Event> event(new Event("commands.onCommand", args.Pass()));
77 event->restrict_to_profile = profile_; 77 event->restrict_to_profile = profile_;
78 event->user_gesture = EventRouter::USER_GESTURE_ENABLED; 78 event->user_gesture = EventRouter::USER_GESTURE_ENABLED;
79 ExtensionSystem::Get(profile_)->event_router()-> 79 ExtensionSystem::Get(profile_)->event_router()->
80 DispatchEventToExtension(extension_id, event.Pass()); 80 DispatchEventToExtension(extension_id, event.Pass());
81 } 81 }
82 82
83 void ExtensionKeybindingRegistry::Observe( 83 void ExtensionKeybindingRegistry::Observe(
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 return true; 135 return true;
136 case PLATFORM_APPS_ONLY: 136 case PLATFORM_APPS_ONLY:
137 return extension->is_platform_app(); 137 return extension->is_platform_app();
138 default: 138 default:
139 NOTREACHED(); 139 NOTREACHED();
140 } 140 }
141 return false; 141 return false;
142 } 142 }
143 143
144 } // namespace extensions 144 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698