<commit_before>// Copyright 2008, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <windows.h>
#include <shlobj.h>
#include <vsstyle.h>
#include <vssym32.h>

#include "chrome/browser/views/options/languages_page_view.h"

#include "base/file_util.h"
#include "base/string_util.h"
#include "base/gfx/native_theme.h"
#include "base/gfx/skia_utils.h"
#include "base/string_util.h"
#include "chrome/app/theme/theme_resources.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/shell_dialogs.h"
#include "chrome/browser/standard_layout.h"
#include "chrome/browser/views/options/language_combobox_model.h"
#include "chrome/browser/views/password_manager_view.h"
#include "chrome/browser/views/restart_message_box.h"
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/gfx/chrome_font.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
#include "chrome/common/resource_bundle.h"
#include "chrome/views/checkbox.h"
#include "chrome/views/combo_box.h"
#include "chrome/views/grid_layout.h"
#include "chrome/views/native_button.h"
#include "chrome/views/radio_button.h"
#include "chrome/views/tabbed_pane.h"
#include "chrome/views/text_field.h"
#include "chrome/views/view_container.h"
#include "generated_resources.h"
#include "skia/include/SkBitmap.h"
#include "unicode/uloc.h"

static const wchar_t* const g_supported_spellchecker_languages[] = {
  L"en-US",
  L"en-GB",
  L"fr-FR",
  L"it-IT",
  L"de-DE",
  L"es-ES",
  L"nl-NL",
  L"pt-BR",
  L"ru-RU",
  L"pl-PL",
  // L"th-TH",  // Not to be included in Spellchecker as per B=1277824
  L"sv-SE",
  L"da-DK",
  L"pt-PT",
  L"ro-RO",
  // L"hu-HU",  // Not to be included in Spellchecker as per B=1277824
  // L"he-IL",  // Not to be included in Spellchecker as per B=1252241
  L"id-ID",
  L"cs-CZ",
  L"el-GR",
  L"nb-NO",
  L"vi-VN",
  // L"bg-BG",  // Not to be included in Spellchecker as per B=1277824
  L"hr-HR",
  L"lt-LT",
  L"sk-SK",
  L"sl-SI",
  L"ca-ES"
  L"lv-LV",
  // L"uk-UA",  // Not to be included in Spellchecker as per B=1277824
  L"hi-IN",
  //
  // TODO(Sidchat): Uncomment/remove languages as and when they get resolved.
  //
};

static const wchar_t* const accept_language_list[] = {
  L"af",     // Afrikaans
  L"am",     // Amharic
  L"ar",     // Arabic
  L"az",     // Azerbaijani
  L"be",     // Belarusian
  L"bg",     // Bulgarian
  L"bh",     // Bihari
  L"bn",     // Bengali
  L"br",     // Breton
  L"bs",     // Bosnian
  L"ca",     // Catalan
  L"co",     // Corsican
  L"cs",     // Czech<commit_msg>Insert a comma<commit_after>// Copyright 2008, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <windows.h>
#include <shlobj.h>
#include <vsstyle.h>
#include <vssym32.h>

#include "chrome/browser/views/options/languages_page_view.h"

#include "base/file_util.h"
#include "base/string_util.h"
#include "base/gfx/native_theme.h"
#include "base/gfx/skia_utils.h"
#include "base/string_util.h"
#include "chrome/app/theme/theme_resources.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/shell_dialogs.h"
#include "chrome/browser/standard_layout.h"
#include "chrome/browser/views/options/language_combobox_model.h"
#include "chrome/browser/views/password_manager_view.h"
#include "chrome/browser/views/restart_message_box.h"
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/gfx/chrome_font.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
#include "chrome/common/resource_bundle.h"
#include "chrome/views/checkbox.h"
#include "chrome/views/combo_box.h"
#include "chrome/views/grid_layout.h"
#include "chrome/views/native_button.h"
#include "chrome/views/radio_button.h"
#include "chrome/views/tabbed_pane.h"
#include "chrome/views/text_field.h"
#include "chrome/views/view_container.h"
#include "generated_resources.h"
#include "skia/include/SkBitmap.h"
#include "unicode/uloc.h"

static const wchar_t* const g_supported_spellchecker_languages[] = {
  L"en-US",
  L"en-GB",
  L"fr-FR",
  L"it-IT",
  L"de-DE",
  L"es-ES",
  L"nl-NL",
  L"pt-BR",
  L"ru-RU",
  L"pl-PL",
  // L"th-TH",  // Not to be included in Spellchecker as per B=1277824
  L"sv-SE",
  L"da-DK",
  L"pt-PT",
  L"ro-RO",
  // L"hu-HU",  // Not to be included in Spellchecker as per B=1277824
  // L"he-IL",  // Not to be included in Spellchecker as per B=1252241
  L"id-ID",
  L"cs-CZ",
  L"el-GR",
  L"nb-NO",
  L"vi-VN",
  // L"bg-BG",  // Not to be included in Spellchecker as per B=1277824
  L"hr-HR",
  L"lt-LT",
  L"sk-SK",
  L"sl-SI",
  L"ca-ES",
  L"lv-LV",
  // L"uk-UA",  // Not to be included in Spellchecker as per B=1277824
  L"hi-IN",
  //
  // TODO(Sidchat): Uncomment/remove languages as and when they get resolved.
  //
};

static const wchar_t* const accept_language_list[] = {
  L"af",     // Afrikaans
  L"am",     // Amharic
  L"ar",     // Arabic
  L"az",     // Azerbaijani
  L"be",     // Belarusian
  L"bg",     // Bulgarian
  L"bh",     // Bihari
  L"bn",     // Bengali
  L"br",     // Breton
  L"bs",     // Bosnian
  L"ca",     // Catalan
  L"co",     // Corsican
  L"cs",     // Czech
{'fraction_non_alphanumeric': 0.1314628767458956, 'fraction_numerical': 0.010536633178142612, 'mean_word_length': 3.6301758366420875, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4933985', 'n_tokens_mistral': 2920, 'n_tokens_neox': 2756, 'n_words': 819}