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

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

Issue 818103002: 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 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_manager.h" 5 #include "components/translate/core/browser/translate_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 TranslateBrowserMetrics::ReportInitiationStatus( 100 TranslateBrowserMetrics::ReportInitiationStatus(
101 TranslateBrowserMetrics::INITIATION_STATUS_DISABLED_BY_PREFS); 101 TranslateBrowserMetrics::INITIATION_STATUS_DISABLED_BY_PREFS);
102 const std::string& locale = 102 const std::string& locale =
103 TranslateDownloadManager::GetInstance()->application_locale(); 103 TranslateDownloadManager::GetInstance()->application_locale();
104 TranslateBrowserMetrics::ReportLocalesOnDisabledByPrefs(locale); 104 TranslateBrowserMetrics::ReportLocalesOnDisabledByPrefs(locale);
105 return; 105 return;
106 } 106 }
107 107
108 // Allow disabling of translate from the command line to assist with 108 // Allow disabling of translate from the command line to assist with
109 // automated browser testing. 109 // automated browser testing.
110 if (CommandLine::ForCurrentProcess()->HasSwitch( 110 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
111 translate::switches::kDisableTranslate)) { 111 translate::switches::kDisableTranslate)) {
112 TranslateBrowserMetrics::ReportInitiationStatus( 112 TranslateBrowserMetrics::ReportInitiationStatus(
113 TranslateBrowserMetrics::INITIATION_STATUS_DISABLED_BY_SWITCH); 113 TranslateBrowserMetrics::INITIATION_STATUS_DISABLED_BY_SWITCH);
114 return; 114 return;
115 } 115 }
116 116
117 // MHTML pages currently cannot be translated. 117 // MHTML pages currently cannot be translated.
118 // See bug: 217945. 118 // See bug: 217945.
119 if (translate_driver_->GetContentsMimeType() == "multipart/related") { 119 if (translate_driver_->GetContentsMimeType() == "multipart/related") {
120 TranslateBrowserMetrics::ReportInitiationStatus( 120 TranslateBrowserMetrics::ReportInitiationStatus(
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 return auto_target_lang; 385 return auto_target_lang;
386 } 386 }
387 return std::string(); 387 return std::string();
388 } 388 }
389 389
390 LanguageState& TranslateManager::GetLanguageState() { 390 LanguageState& TranslateManager::GetLanguageState() {
391 return language_state_; 391 return language_state_;
392 } 392 }
393 393
394 } // namespace translate 394 } // namespace translate
OLDNEW
« no previous file with comments | « components/translate/core/browser/translate_download_manager.cc ('k') | components/translate/core/browser/translate_script.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698