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

Side by Side Diff: content/shell/common/webkit_test_helpers.cc

Issue 803813003: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
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 "content/shell/common/webkit_test_helpers.h" 5 #include "content/shell/common/webkit_test_helpers.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 to->javascript_can_open_windows_automatically = 48 to->javascript_can_open_windows_automatically =
49 from.java_script_can_open_windows_automatically; 49 from.java_script_can_open_windows_automatically;
50 to->web_security_enabled = 50 to->web_security_enabled =
51 from.web_security_enabled; 51 from.web_security_enabled;
52 } 52 }
53 53
54 // Applies settings that differ between layout tests and regular mode. Some 54 // Applies settings that differ between layout tests and regular mode. Some
55 // of the defaults are controlled via command line flags which are 55 // of the defaults are controlled via command line flags which are
56 // automatically set for layout tests. 56 // automatically set for layout tests.
57 void ApplyLayoutTestDefaultPreferences(WebPreferences* prefs) { 57 void ApplyLayoutTestDefaultPreferences(WebPreferences* prefs) {
58 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 58 const base::CommandLine& command_line =
59 *base::CommandLine::ForCurrentProcess();
59 prefs->allow_universal_access_from_file_urls = true; 60 prefs->allow_universal_access_from_file_urls = true;
60 prefs->dom_paste_enabled = true; 61 prefs->dom_paste_enabled = true;
61 prefs->javascript_can_access_clipboard = true; 62 prefs->javascript_can_access_clipboard = true;
62 prefs->xslt_enabled = true; 63 prefs->xslt_enabled = true;
63 prefs->xss_auditor_enabled = false; 64 prefs->xss_auditor_enabled = false;
64 #if defined(OS_MACOSX) 65 #if defined(OS_MACOSX)
65 prefs->editing_behavior = EDITING_BEHAVIOR_MAC; 66 prefs->editing_behavior = EDITING_BEHAVIOR_MAC;
66 #else 67 #else
67 prefs->editing_behavior = EDITING_BEHAVIOR_WIN; 68 prefs->editing_behavior = EDITING_BEHAVIOR_WIN;
68 #endif 69 #endif
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 } 105 }
105 106
106 base::FilePath GetWebKitRootDirFilePath() { 107 base::FilePath GetWebKitRootDirFilePath() {
107 base::FilePath base_path; 108 base::FilePath base_path;
108 PathService::Get(base::DIR_SOURCE_ROOT, &base_path); 109 PathService::Get(base::DIR_SOURCE_ROOT, &base_path);
109 return base_path.Append(FILE_PATH_LITERAL("third_party/WebKit")); 110 return base_path.Append(FILE_PATH_LITERAL("third_party/WebKit"));
110 } 111 }
111 112
112 std::vector<std::string> GetSideloadFontFiles() { 113 std::vector<std::string> GetSideloadFontFiles() {
113 std::vector<std::string> files; 114 std::vector<std::string> files;
114 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 115 const base::CommandLine& command_line =
116 *base::CommandLine::ForCurrentProcess();
115 if (command_line.HasSwitch(switches::kRegisterFontFiles)) { 117 if (command_line.HasSwitch(switches::kRegisterFontFiles)) {
116 base::SplitString( 118 base::SplitString(
117 command_line.GetSwitchValueASCII(switches::kRegisterFontFiles), 119 command_line.GetSwitchValueASCII(switches::kRegisterFontFiles),
118 ';', 120 ';',
119 &files); 121 &files);
120 } 122 }
121 return files; 123 return files;
122 } 124 }
123 125
124 } // namespace content 126 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698