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

Side by Side Diff: chrome/browser/accessibility/accessibility_extension_api.cc

Issue 10514013: Filtered events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add API permission check to filtered events :-| Created 8 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/accessibility/accessibility_extension_api.h" 5 #include "chrome/browser/accessibility/accessibility_extension_api.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/accessibility/accessibility_extension_api_constants.h" 10 #include "chrome/browser/accessibility/accessibility_extension_api_constants.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 std::string json_args = ControlInfoToJsonString(info); 157 std::string json_args = ControlInfoToJsonString(info);
158 DispatchEvent(info->profile(), keys::kOnMenuClosed, json_args); 158 DispatchEvent(info->profile(), keys::kOnMenuClosed, json_args);
159 } 159 }
160 160
161 void ExtensionAccessibilityEventRouter::DispatchEvent( 161 void ExtensionAccessibilityEventRouter::DispatchEvent(
162 Profile* profile, 162 Profile* profile,
163 const char* event_name, 163 const char* event_name,
164 const std::string& json_args) { 164 const std::string& json_args) {
165 if (enabled_ && profile && profile->GetExtensionEventRouter()) { 165 if (enabled_ && profile && profile->GetExtensionEventRouter()) {
166 profile->GetExtensionEventRouter()->DispatchEventToRenderers( 166 profile->GetExtensionEventRouter()->DispatchEventToRenderers(
167 event_name, json_args, NULL, GURL()); 167 event_name, json_args, NULL, GURL(), extensions::EventFilteringInfo());
Aaron Boodman 2012/06/15 07:34:51 It's allowed style-wise to provide overloads that
battre 2012/06/15 07:45:59 are you sure? http://google-styleguide.googlecode.
koz (OOO until 15th September) 2012/06/18 23:27:27 B'oh! So wait, the takeaway is that you can have d
168 } 168 }
169 } 169 }
170 170
171 bool SetAccessibilityEnabledFunction::RunImpl() { 171 bool SetAccessibilityEnabledFunction::RunImpl() {
172 bool enabled; 172 bool enabled;
173 EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(0, &enabled)); 173 EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(0, &enabled));
174 ExtensionAccessibilityEventRouter::GetInstance() 174 ExtensionAccessibilityEventRouter::GetInstance()
175 ->SetAccessibilityEnabled(enabled); 175 ->SetAccessibilityEnabled(enabled);
176 return true; 176 return true;
177 } 177 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 DictionaryValue* alert_value = new DictionaryValue; 219 DictionaryValue* alert_value = new DictionaryValue;
220 const string16 message_text = confirm_infobar_delegate->GetMessageText(); 220 const string16 message_text = confirm_infobar_delegate->GetMessageText();
221 alert_value->SetString(keys::kMessageKey, message_text); 221 alert_value->SetString(keys::kMessageKey, message_text);
222 alerts_value->Append(alert_value); 222 alerts_value->Append(alert_value);
223 } 223 }
224 } 224 }
225 225
226 result_.reset(alerts_value); 226 result_.reset(alerts_value);
227 return true; 227 return true;
228 } 228 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/bookmarks/bookmark_extension_api.cc » ('j') | chrome/browser/extensions/event_listener_map.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698