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

Side by Side Diff: components/translate/core/common/translate_util.cc

Issue 93603006: Move Translate-related files to components/translate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/common/translate_util.h" 5 #include "components/translate/core/common/translate_util.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
11 #include "components/translate/common/translate_switches.h" 11 #include "components/translate/core/common/translate_switches.h"
12 #include "url/gurl.h" 12 #include "url/gurl.h"
13 13
14 namespace { 14 namespace {
15 15
16 // Split the |language| into two parts. For example, if |language| is 'en-US', 16 // 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'. 17 // this will be split into the main part 'en' and the tail part '-US'.
18 void SplitIntoMainAndTail(const std::string& language, 18 void SplitIntoMainAndTail(const std::string& language,
19 std::string* main_part, 19 std::string* main_part,
20 std::string* tail_part) { 20 std::string* tail_part) {
21 DCHECK(main_part); 21 DCHECK(main_part);
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 std::string security_origin(kSecurityOrigin); 116 std::string security_origin(kSecurityOrigin);
117 CommandLine* command_line = CommandLine::ForCurrentProcess(); 117 CommandLine* command_line = CommandLine::ForCurrentProcess();
118 if (command_line->HasSwitch(switches::kTranslateSecurityOrigin)) { 118 if (command_line->HasSwitch(switches::kTranslateSecurityOrigin)) {
119 security_origin = 119 security_origin =
120 command_line->GetSwitchValueASCII(switches::kTranslateSecurityOrigin); 120 command_line->GetSwitchValueASCII(switches::kTranslateSecurityOrigin);
121 } 121 }
122 return GURL(security_origin); 122 return GURL(security_origin);
123 } 123 }
124 124
125 } // namespace translate 125 } // namespace translate
OLDNEW
« no previous file with comments | « components/translate/core/common/translate_util.h ('k') | components/translate/core/common/translate_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698