OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/webui/extensions/extension_loader_handler.h" | 5 #include "chrome/browser/ui/webui/extensions/extension_loader_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 failure->Set("error", new base::StringValue(base::UTF8ToUTF16(error))); | 199 failure->Set("error", new base::StringValue(base::UTF8ToUTF16(error))); |
200 failure->Set("manifest", manifest_value.release()); | 200 failure->Set("manifest", manifest_value.release()); |
201 failures_.Append(failure.release()); | 201 failures_.Append(failure.release()); |
202 | 202 |
203 // Only notify the frontend if the frontend UI is ready. | 203 // Only notify the frontend if the frontend UI is ready. |
204 if (ui_ready_) | 204 if (ui_ready_) |
205 NotifyFrontendOfFailure(); | 205 NotifyFrontendOfFailure(); |
206 } | 206 } |
207 | 207 |
208 void ExtensionLoaderHandler::NotifyFrontendOfFailure() { | 208 void ExtensionLoaderHandler::NotifyFrontendOfFailure() { |
209 web_ui()->CallJavascriptFunction( | 209 web_ui()->CallJavascriptFunctionUnsafe( |
210 "extensions.ExtensionLoader.notifyLoadFailed", | 210 "extensions.ExtensionLoader.notifyLoadFailed", failures_); |
211 failures_); | |
212 failures_.Clear(); | 211 failures_.Clear(); |
213 } | 212 } |
214 | 213 |
215 } // namespace extensions | 214 } // namespace extensions |
OLD | NEW |