| 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 "components/translate/core/common/translate_util.h" | 5 #include "components/translate/core/common/translate_util.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include <stddef.h> |
| 8 |
| 8 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/macros.h" |
| 10 #include "base/strings/string_split.h" | 12 #include "base/strings/string_split.h" |
| 11 #include "components/translate/core/common/translate_switches.h" | 13 #include "components/translate/core/common/translate_switches.h" |
| 12 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 13 | 15 |
| 14 namespace { | 16 namespace { |
| 15 | 17 |
| 16 // Split the |language| into two parts. For example, if |language| is 'en-US', | 18 // Split the |language| into two parts. For example, if |language| is 'en-US', |
| 17 // this will be split into the main part 'en' and the tail part '-US'. | 19 // this will be split into the main part 'en' and the tail part '-US'. |
| 18 void SplitIntoMainAndTail(const std::string& language, | 20 void SplitIntoMainAndTail(const std::string& language, |
| 19 std::string* main_part, | 21 std::string* main_part, |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 std::string security_origin(kSecurityOrigin); | 144 std::string security_origin(kSecurityOrigin); |
| 143 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 145 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 144 if (command_line->HasSwitch(switches::kTranslateSecurityOrigin)) { | 146 if (command_line->HasSwitch(switches::kTranslateSecurityOrigin)) { |
| 145 security_origin = | 147 security_origin = |
| 146 command_line->GetSwitchValueASCII(switches::kTranslateSecurityOrigin); | 148 command_line->GetSwitchValueASCII(switches::kTranslateSecurityOrigin); |
| 147 } | 149 } |
| 148 return GURL(security_origin); | 150 return GURL(security_origin); |
| 149 } | 151 } |
| 150 | 152 |
| 151 } // namespace translate | 153 } // namespace translate |
| OLD | NEW |