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

Side by Side Diff: chrome/browser/ui/webui/extensions/extension_loader_handler.cc

Issue 422533002: Fix Regression in Unpacked Extension Load Error UI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
« no previous file with comments | « chrome/browser/resources/extensions/extension_loader.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/file_util.h" 8 #include "base/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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 installer->set_be_noisy_on_failure(false); 226 installer->set_be_noisy_on_failure(false);
227 227
228 installer->Load(file_path); 228 installer->Load(file_path);
229 } 229 }
230 230
231 void ExtensionLoaderHandler::OnLoadFailure(const base::FilePath& file_path, 231 void ExtensionLoaderHandler::OnLoadFailure(const base::FilePath& file_path,
232 const std::string& error) { 232 const std::string& error) {
233 size_t line = 0u; 233 size_t line = 0u;
234 size_t column = 0u; 234 size_t column = 0u;
235 std::string regex = 235 std::string regex =
236 base::StringPrintf("%s Line: (\\d+), column: (\\d+), Syntax error.", 236 base::StringPrintf("%s Line: (\\d+), column: (\\d+), .*",
237 manifest_errors::kManifestParseError); 237 manifest_errors::kManifestParseError);
238 // If this was a JSON parse error, we can highlight the exact line with the 238 // If this was a JSON parse error, we can highlight the exact line with the
239 // error. Otherwise, we should still display the manifest (for consistency, 239 // error. Otherwise, we should still display the manifest (for consistency,
240 // reference, and so that if we ever make this really fancy and add an editor, 240 // reference, and so that if we ever make this really fancy and add an editor,
241 // it's ready). 241 // it's ready).
242 // 242 //
243 // This regex call can fail, but if it does, we just don't highlight anything. 243 // This regex call can fail, but if it does, we just don't highlight anything.
244 re2::RE2::FullMatch(error, regex, &line, &column); 244 re2::RE2::FullMatch(error, regex, &line, &column);
245 245
246 // This will read the manifest and call AddFailure with the read manifest 246 // This will read the manifest and call AddFailure with the read manifest
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 } 294 }
295 295
296 void ExtensionLoaderHandler::NotifyFrontendOfFailure() { 296 void ExtensionLoaderHandler::NotifyFrontendOfFailure() {
297 web_ui()->CallJavascriptFunction( 297 web_ui()->CallJavascriptFunction(
298 "extensions.ExtensionLoader.notifyLoadFailed", 298 "extensions.ExtensionLoader.notifyLoadFailed",
299 failures_); 299 failures_);
300 failures_.Clear(); 300 failures_.Clear();
301 } 301 }
302 302
303 } // namespace extensions 303 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/resources/extensions/extension_loader.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698