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

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

Issue 1550383002: Convert Pass()→std::move() in //components (Android edition) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « components/sessions/core/in_memory_tab_restore_service.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_infobar_delegate.h" 5 #include "components/translate/core/browser/translate_infobar_delegate.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility>
8 9
9 #include "base/i18n/string_compare.h" 10 #include "base/i18n/string_compare.h"
10 #include "base/metrics/histogram_macros.h" 11 #include "base/metrics/histogram_macros.h"
11 #include "build/build_config.h" 12 #include "build/build_config.h"
12 #include "components/infobars/core/infobar.h" 13 #include "components/infobars/core/infobar.h"
13 #include "components/infobars/core/infobar_manager.h" 14 #include "components/infobars/core/infobar_manager.h"
14 #include "components/translate/core/browser/language_state.h" 15 #include "components/translate/core/browser/language_state.h"
15 #include "components/translate/core/browser/translate_accept_languages.h" 16 #include "components/translate/core/browser/translate_accept_languages.h"
16 #include "components/translate/core/browser/translate_client.h" 17 #include "components/translate/core/browser/translate_client.h"
17 #include "components/translate/core/browser/translate_download_manager.h" 18 #include "components/translate/core/browser/translate_download_manager.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 } 99 }
99 } 100 }
100 101
101 // Add the new delegate. 102 // Add the new delegate.
102 scoped_ptr<infobars::InfoBar> infobar(translate_client->CreateInfoBar( 103 scoped_ptr<infobars::InfoBar> infobar(translate_client->CreateInfoBar(
103 scoped_ptr<TranslateInfoBarDelegate>(new TranslateInfoBarDelegate( 104 scoped_ptr<TranslateInfoBarDelegate>(new TranslateInfoBarDelegate(
104 translate_manager, is_off_the_record, step, old_delegate, 105 translate_manager, is_off_the_record, step, old_delegate,
105 original_language, target_language, error_type, 106 original_language, target_language, error_type,
106 triggered_from_menu)))); 107 triggered_from_menu))));
107 if (old_delegate) 108 if (old_delegate)
108 infobar_manager->ReplaceInfoBar(old_infobar, infobar.Pass()); 109 infobar_manager->ReplaceInfoBar(old_infobar, std::move(infobar));
109 else 110 else
110 infobar_manager->AddInfoBar(infobar.Pass()); 111 infobar_manager->AddInfoBar(std::move(infobar));
111 } 112 }
112 113
113 void TranslateInfoBarDelegate::UpdateOriginalLanguage( 114 void TranslateInfoBarDelegate::UpdateOriginalLanguage(
114 const std::string& language_code) { 115 const std::string& language_code) {
115 ui_delegate_.UpdateOriginalLanguage(language_code); 116 ui_delegate_.UpdateOriginalLanguage(language_code);
116 } 117 }
117 118
118 void TranslateInfoBarDelegate::UpdateTargetLanguage( 119 void TranslateInfoBarDelegate::UpdateTargetLanguage(
119 const std::string& language_code) { 120 const std::string& language_code) {
120 ui_delegate_.UpdateTargetLanguage(language_code); 121 ui_delegate_.UpdateTargetLanguage(language_code);
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 TranslationDeclined(); 366 TranslationDeclined();
366 UMA_HISTOGRAM_BOOLEAN("Translate.DeclineTranslateCloseInfobar", true); 367 UMA_HISTOGRAM_BOOLEAN("Translate.DeclineTranslateCloseInfobar", true);
367 } 368 }
368 369
369 TranslateInfoBarDelegate* 370 TranslateInfoBarDelegate*
370 TranslateInfoBarDelegate::AsTranslateInfoBarDelegate() { 371 TranslateInfoBarDelegate::AsTranslateInfoBarDelegate() {
371 return this; 372 return this;
372 } 373 }
373 374
374 } // namespace translate 375 } // namespace translate
OLDNEW
« no previous file with comments | « components/sessions/core/in_memory_tab_restore_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698