| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This implementation supposes a single extension thread and synchronized | 5 // This implementation supposes a single extension thread and synchronized |
| 6 // method invokation. | 6 // method invokation. |
| 7 | 7 |
| 8 #include "chrome/browser/extensions/extension_idle_api.h" | 8 #include "chrome/browser/extensions/extension_idle_api.h" |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 void ExtensionIdleEventRouter::OnIdleStateChange(Profile* profile, | 147 void ExtensionIdleEventRouter::OnIdleStateChange(Profile* profile, |
| 148 IdleState state) { | 148 IdleState state) { |
| 149 // Prepare the single argument of the current state. | 149 // Prepare the single argument of the current state. |
| 150 ListValue args; | 150 ListValue args; |
| 151 args.Append(CreateIdleValue(state)); | 151 args.Append(CreateIdleValue(state)); |
| 152 std::string json_args; | 152 std::string json_args; |
| 153 base::JSONWriter::Write(&args, false, &json_args); | 153 base::JSONWriter::Write(&args, false, &json_args); |
| 154 | 154 |
| 155 profile->GetExtensionMessageService()->DispatchEventToRenderers( | 155 profile->GetExtensionMessageService()->DispatchEventToRenderers( |
| 156 keys::kOnStateChanged, | 156 keys::kOnStateChanged, json_args, profile, GURL()); |
| 157 json_args, | |
| 158 profile->IsOffTheRecord(), | |
| 159 GURL()); | |
| 160 } | 157 } |
| OLD | NEW |