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

Side by Side Diff: chrome/browser/extensions/user_script_master.cc

Issue 109673004: Revert "Update all users of base::Version to explicitly specify the namespace, and clean up the hea… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
OLDNEW
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/user_script_master.h" 5 #include "chrome/browser/extensions/user_script_master.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 script->add_glob(value); 108 script->add_glob(value);
109 } else if (GetDeclarationValue(line, kExcludeDeclaration, &value)) { 109 } else if (GetDeclarationValue(line, kExcludeDeclaration, &value)) {
110 ReplaceSubstringsAfterOffset(&value, 0, "\\", "\\\\"); 110 ReplaceSubstringsAfterOffset(&value, 0, "\\", "\\\\");
111 ReplaceSubstringsAfterOffset(&value, 0, "?", "\\?"); 111 ReplaceSubstringsAfterOffset(&value, 0, "?", "\\?");
112 script->add_exclude_glob(value); 112 script->add_exclude_glob(value);
113 } else if (GetDeclarationValue(line, kNamespaceDeclaration, &value)) { 113 } else if (GetDeclarationValue(line, kNamespaceDeclaration, &value)) {
114 script->set_name_space(value); 114 script->set_name_space(value);
115 } else if (GetDeclarationValue(line, kNameDeclaration, &value)) { 115 } else if (GetDeclarationValue(line, kNameDeclaration, &value)) {
116 script->set_name(value); 116 script->set_name(value);
117 } else if (GetDeclarationValue(line, kVersionDeclaration, &value)) { 117 } else if (GetDeclarationValue(line, kVersionDeclaration, &value)) {
118 base::Version version(value); 118 Version version(value);
119 if (version.IsValid()) 119 if (version.IsValid())
120 script->set_version(version.GetString()); 120 script->set_version(version.GetString());
121 } else if (GetDeclarationValue(line, kDescriptionDeclaration, &value)) { 121 } else if (GetDeclarationValue(line, kDescriptionDeclaration, &value)) {
122 script->set_description(value); 122 script->set_description(value);
123 } else if (GetDeclarationValue(line, kMatchDeclaration, &value)) { 123 } else if (GetDeclarationValue(line, kMatchDeclaration, &value)) {
124 URLPattern pattern(UserScript::ValidUserScriptSchemes()); 124 URLPattern pattern(UserScript::ValidUserScriptSchemes());
125 if (URLPattern::PARSE_SUCCESS != pattern.Parse(value)) 125 if (URLPattern::PARSE_SUCCESS != pattern.Parse(value))
126 return false; 126 return false;
127 script->add_url_pattern(pattern); 127 script->add_url_pattern(pattern);
128 } else if (GetDeclarationValue(line, kExcludeMatchDeclaration, &value)) { 128 } else if (GetDeclarationValue(line, kExcludeMatchDeclaration, &value)) {
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 458
459 base::SharedMemoryHandle handle_for_process; 459 base::SharedMemoryHandle handle_for_process;
460 if (!shared_memory->ShareToProcess(handle, &handle_for_process)) 460 if (!shared_memory->ShareToProcess(handle, &handle_for_process))
461 return; // This can legitimately fail if the renderer asserts at startup. 461 return; // This can legitimately fail if the renderer asserts at startup.
462 462
463 if (base::SharedMemory::IsHandleValid(handle_for_process)) 463 if (base::SharedMemory::IsHandleValid(handle_for_process))
464 process->Send(new ExtensionMsg_UpdateUserScripts(handle_for_process)); 464 process->Send(new ExtensionMsg_UpdateUserScripts(handle_for_process));
465 } 465 }
466 466
467 } // namespace extensions 467 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/updater/extension_updater_unittest.cc ('k') | chrome/browser/extensions/webstore_installer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698