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

Side by Side Diff: chrome/browser/ui/translate/translate_denial_combobox_model.cc

Issue 330443004: Bug fix: Translate: leak of a ComboboxModel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the order of the member variables Created 6 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/translate/translate_denial_combobox_model.h"
6
7 #include "grit/generated_resources.h"
8 #include "ui/base/l10n/l10n_util.h"
9
10 TranslateDenialComboboxModel::TranslateDenialComboboxModel(
11 const base::string16& original_language_name) {
12 items_.push_back(l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_DENY));
13 items_.push_back(base::string16());
14 items_.push_back(l10n_util::GetStringFUTF16(
15 IDS_TRANSLATE_BUBBLE_NEVER_TRANSLATE_LANG,
16 original_language_name));
17 items_.push_back(base::string16());
18 items_.push_back(l10n_util::GetStringUTF16(
19 IDS_TRANSLATE_BUBBLE_NEVER_TRANSLATE_SITE));
20 }
21
22 TranslateDenialComboboxModel::~TranslateDenialComboboxModel() {}
23
24 int TranslateDenialComboboxModel::GetItemCount() const {
25 return items_.size();
26 }
27
28 base::string16 TranslateDenialComboboxModel::GetItemAt(int index) {
29 return items_[index];
30 }
31
32 bool TranslateDenialComboboxModel::IsItemSeparatorAt(int index) {
33 return items_[index].empty();
34 }
35
36 int TranslateDenialComboboxModel::GetDefaultIndex() const {
37 return 0;
38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698