summaryrefslogtreecommitdiffstats
path: root/chrome/browser/translate/options_menu_model.cc
blob: 5f0dd66ed54a2a398cc2036c5f6ac86673c10ea6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/translate/options_menu_model.h"

#include "app/l10n_util.h"
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/translate/translate_infobars_delegates.h"
#include "grit/generated_resources.h"

OptionsMenuModel::OptionsMenuModel(menus::SimpleMenuModel::Delegate* delegate,
    TranslateInfoBarDelegate* translate_delegate)
    : menus::SimpleMenuModel(delegate) {
  string16 original_language = translate_delegate->GetDisplayNameForLocale(
      translate_delegate->original_lang_code());
  string16 target_language = translate_delegate->GetDisplayNameForLocale(
      translate_delegate->target_lang_code());
  AddCheckItem(IDC_TRANSLATE_OPTIONS_ALWAYS,
      l10n_util::GetStringFUTF16(IDS_TRANSLATE_INFOBAR_OPTIONS_ALWAYS,
          original_language, target_language));
  AddCheckItem(IDC_TRANSLATE_OPTIONS_NEVER_TRANSLATE_LANG,
      l10n_util::GetStringFUTF16(
          IDS_TRANSLATE_INFOBAR_OPTIONS_NEVER_TRANSLATE_LANG,
          original_language));
  AddCheckItem(IDC_TRANSLATE_OPTIONS_NEVER_TRANSLATE_SITE,
      l10n_util::GetStringUTF16(
          IDS_TRANSLATE_INFOBAR_OPTIONS_NEVER_TRANSLATE_SITE));
  AddItemWithStringId(IDC_TRANSLATE_OPTIONS_ABOUT,
      IDS_TRANSLATE_INFOBAR_OPTIONS_ABOUT);
}

OptionsMenuModel::~OptionsMenuModel() {
}