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

Side by Side Diff: components/translate/core/browser/translate_ui_delegate.cc

Issue 1548203002: Convert Pass()→std::move() in //components/[n-z]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bad headers Created 4 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 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/browser/translate_ui_delegate.h" 5 #include "components/translate/core/browser/translate_ui_delegate.h"
6 6
7 #include "base/i18n/string_compare.h" 7 #include "base/i18n/string_compare.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "components/translate/core/browser/language_state.h" 9 #include "components/translate/core/browser/language_state.h"
10 #include "components/translate/core/browser/translate_client.h" 10 #include "components/translate/core/browser/translate_client.h"
(...skipping 22 matching lines...) Expand all
33 // null if unable to find the right collator. 33 // null if unable to find the right collator.
34 // 34 //
35 // TODO(hajimehoshi): Write a test for icu::Collator::createInstance. 35 // TODO(hajimehoshi): Write a test for icu::Collator::createInstance.
36 scoped_ptr<icu::Collator> CreateCollator(const std::string& locale) { 36 scoped_ptr<icu::Collator> CreateCollator(const std::string& locale) {
37 UErrorCode error = U_ZERO_ERROR; 37 UErrorCode error = U_ZERO_ERROR;
38 icu::Locale loc(locale.c_str()); 38 icu::Locale loc(locale.c_str());
39 scoped_ptr<icu::Collator> collator(icu::Collator::createInstance(loc, error)); 39 scoped_ptr<icu::Collator> collator(icu::Collator::createInstance(loc, error));
40 if (!collator || !U_SUCCESS(error)) 40 if (!collator || !U_SUCCESS(error))
41 return nullptr; 41 return nullptr;
42 collator->setStrength(icu::Collator::PRIMARY); 42 collator->setStrength(icu::Collator::PRIMARY);
43 return collator.Pass(); 43 return collator;
44 } 44 }
45 45
46 } // namespace 46 } // namespace
47 47
48 namespace translate { 48 namespace translate {
49 49
50 TranslateUIDelegate::TranslateUIDelegate( 50 TranslateUIDelegate::TranslateUIDelegate(
51 const base::WeakPtr<TranslateManager>& translate_manager, 51 const base::WeakPtr<TranslateManager>& translate_manager,
52 const std::string& original_language, 52 const std::string& original_language,
53 const std::string& target_language) 53 const std::string& target_language)
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 UMA_HISTOGRAM_BOOLEAN(kAlwaysTranslateLang, true); 298 UMA_HISTOGRAM_BOOLEAN(kAlwaysTranslateLang, true);
299 } 299 }
300 300
301 std::string TranslateUIDelegate::GetPageHost() { 301 std::string TranslateUIDelegate::GetPageHost() {
302 if (!translate_driver_->HasCurrentPage()) 302 if (!translate_driver_->HasCurrentPage())
303 return std::string(); 303 return std::string();
304 return translate_driver_->GetLastCommittedURL().HostNoBrackets(); 304 return translate_driver_->GetLastCommittedURL().HostNoBrackets();
305 } 305 }
306 306
307 } // namespace translate 307 } // namespace translate
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698