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

Side by Side Diff: chrome/browser/translate/translate_manager.cc

Issue 15970002: Add the new UMA key 'Translate.LocalesOnDisabledByPrefs'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: (Rebasing) Created 7 years, 6 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 | « no previous file | chrome/browser/translate/translate_manager_metrics.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/translate/translate_manager.h" 5 #include "chrome/browser/translate/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/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 } 385 }
386 386
387 void TranslateManager::InitiateTranslation(WebContents* web_contents, 387 void TranslateManager::InitiateTranslation(WebContents* web_contents,
388 const std::string& page_lang) { 388 const std::string& page_lang) {
389 Profile* profile = 389 Profile* profile =
390 Profile::FromBrowserContext(web_contents->GetBrowserContext()); 390 Profile::FromBrowserContext(web_contents->GetBrowserContext());
391 PrefService* prefs = profile->GetOriginalProfile()->GetPrefs(); 391 PrefService* prefs = profile->GetOriginalProfile()->GetPrefs();
392 if (!prefs->GetBoolean(prefs::kEnableTranslate)) { 392 if (!prefs->GetBoolean(prefs::kEnableTranslate)) {
393 TranslateManagerMetrics::ReportInitiationStatus( 393 TranslateManagerMetrics::ReportInitiationStatus(
394 TranslateManagerMetrics::INITIATION_STATUS_DISABLED_BY_PREFS); 394 TranslateManagerMetrics::INITIATION_STATUS_DISABLED_BY_PREFS);
395 const std::string& locale = g_browser_process->GetApplicationLocale();
396 TranslateManagerMetrics::ReportLocalesOnDisabledByPrefs(locale);
395 return; 397 return;
396 } 398 }
397 399
398 // Allow disabling of translate from the command line to assist with 400 // Allow disabling of translate from the command line to assist with
399 // automated browser testing. 401 // automated browser testing.
400 if (CommandLine::ForCurrentProcess()->HasSwitch( 402 if (CommandLine::ForCurrentProcess()->HasSwitch(
401 switches::kDisableTranslate)) { 403 switches::kDisableTranslate)) {
402 TranslateManagerMetrics::ReportInitiationStatus( 404 TranslateManagerMetrics::ReportInitiationStatus(
403 TranslateManagerMetrics::INITIATION_STATUS_DISABLED_BY_SWITCH); 405 TranslateManagerMetrics::INITIATION_STATUS_DISABLED_BY_SWITCH);
404 return; 406 return;
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 // reason so we are more aggressive showing the shortcuts for never translate. 828 // reason so we are more aggressive showing the shortcuts for never translate.
827 #if defined(OS_ANDROID) 829 #if defined(OS_ANDROID)
828 config.never_translate_min_count = 1; 830 config.never_translate_min_count = 1;
829 #else 831 #else
830 config.never_translate_min_count = 3; 832 config.never_translate_min_count = 3;
831 #endif // defined(OS_ANDROID) 833 #endif // defined(OS_ANDROID)
832 834
833 config.always_translate_min_count = 3; 835 config.always_translate_min_count = 3;
834 return config; 836 return config;
835 } 837 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/translate/translate_manager_metrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698