| 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/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/extensions/api/preference/preference_api.h" | 10 #include "chrome/browser/extensions/api/preference/preference_api.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 restrict_to_profile = profile->GetOffTheRecordProfile(); | 119 restrict_to_profile = profile->GetOffTheRecordProfile(); |
| 120 } else if (!incognito && | 120 } else if (!incognito && |
| 121 PreferenceAPI::Get(profile)->DoesExtensionControlPref( | 121 PreferenceAPI::Get(profile)->DoesExtensionControlPref( |
| 122 extension->id(), browser_pref, &from_incognito) && | 122 extension->id(), browser_pref, &from_incognito) && |
| 123 from_incognito) { | 123 from_incognito) { |
| 124 restrict_to_profile = profile; | 124 restrict_to_profile = profile; |
| 125 } | 125 } |
| 126 } | 126 } |
| 127 | 127 |
| 128 scoped_ptr<base::ListValue> args_copy(args->DeepCopy()); | 128 scoped_ptr<base::ListValue> args_copy(args->DeepCopy()); |
| 129 scoped_ptr<Event> event(new Event(event_name, args_copy.Pass())); | 129 scoped_ptr<Event> event( |
| 130 new Event(events::UNKNOWN, event_name, args_copy.Pass())); |
| 130 event->restrict_to_browser_context = restrict_to_profile; | 131 event->restrict_to_browser_context = restrict_to_profile; |
| 131 router->DispatchEventToExtension(extension->id(), event.Pass()); | 132 router->DispatchEventToExtension(extension->id(), event.Pass()); |
| 132 } | 133 } |
| 133 } | 134 } |
| 134 } | 135 } |
| 135 | 136 |
| 136 } // namespace preference_helpers | 137 } // namespace preference_helpers |
| 137 } // namespace extensions | 138 } // namespace extensions |
| OLD | NEW |