| OLD | NEW |
| 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/preference/preference_helpers.h" | 5 #include "chrome/browser/extensions/api/preference/preference_helpers.h" |
| 6 | 6 |
| 7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/extensions/event_router.h" | 9 #include "chrome/browser/extensions/event_router.h" |
| 10 #include "chrome/browser/extensions/extension_prefs.h" | 10 #include "chrome/browser/extensions/extension_prefs.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 extension_prefs->DoesExtensionControlPref( | 121 extension_prefs->DoesExtensionControlPref( |
| 122 extension_id, | 122 extension_id, |
| 123 browser_pref, | 123 browser_pref, |
| 124 &from_incognito) && | 124 &from_incognito) && |
| 125 from_incognito) { | 125 from_incognito) { |
| 126 restrict_to_profile = profile; | 126 restrict_to_profile = profile; |
| 127 } | 127 } |
| 128 } | 128 } |
| 129 | 129 |
| 130 scoped_ptr<ListValue> args_copy(args->DeepCopy()); | 130 scoped_ptr<ListValue> args_copy(args->DeepCopy()); |
| 131 router->DispatchEventToExtension( | 131 scoped_ptr<Event> event(new Event(event_name, args_copy.Pass())); |
| 132 extension_id, event_name, args_copy.Pass(), restrict_to_profile, | 132 event->restrict_to_profile = restrict_to_profile; |
| 133 GURL()); | 133 router->DispatchEventToExtension(extension_id, event.Pass()); |
| 134 } | 134 } |
| 135 } | 135 } |
| 136 } | 136 } |
| 137 | 137 |
| 138 } // namespace preference_helpers | 138 } // namespace preference_helpers |
| 139 } // namespace extensions | 139 } // namespace extensions |
| OLD | NEW |