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

Unified Diff: chrome/browser/ui/translate/translate_denial_combobox_model.h

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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/translate/translate_denial_combobox_model.h
diff --git a/chrome/browser/ui/translate/translate_denial_combobox_model.h b/chrome/browser/ui/translate/translate_denial_combobox_model.h
new file mode 100644
index 0000000000000000000000000000000000000000..08ced5c0318c4a180ce04f11f35eec03e418bb8a
--- /dev/null
+++ b/chrome/browser/ui/translate/translate_denial_combobox_model.h
@@ -0,0 +1,37 @@
+// Copyright 2014 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.
+
+#ifndef CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_DENIAL_COMBOBOX_MODEL_H_
+#define CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_DENIAL_COMBOBOX_MODEL_H_
+
+#include <vector>
+
+#include "base/basictypes.h"
+#include "ui/base/models/combobox_model.h"
+
+class TranslateDenialComboboxModel : public ui::ComboboxModel {
sky 2014/06/17 16:30:38 How about a SimpleComboboxModel in ui/base/models
hajimehoshi 2014/06/18 08:33:37 Done.
+ public:
+ enum {
sky 2014/06/17 16:30:38 Generally we use C++ style for enums.
hajimehoshi 2014/06/18 08:33:37 Done.
+ INDEX_NOPE = 0,
+ INDEX_NEVER_TRANSLATE_LANGUAGE = 2,
+ INDEX_NEVER_TRANSLATE_SITE = 4,
+ };
+
+ explicit TranslateDenialComboboxModel(
+ const base::string16& original_language_name);
+ virtual ~TranslateDenialComboboxModel();
+
+ private:
+ // Overridden from ui::ComboboxModel:
+ virtual int GetItemCount() const OVERRIDE;
+ virtual base::string16 GetItemAt(int index);
+ virtual bool IsItemSeparatorAt(int index);
+ virtual int GetDefaultIndex() const;
+
+ std::vector<base::string16> items_;
+
+ DISALLOW_COPY_AND_ASSIGN(TranslateDenialComboboxModel);
+};
+
+#endif // CHROME_BROWSER_UI_TRANSLATE_TRANSLATE_DENIAL_COMBOBOX_MODEL_H_

Powered by Google App Engine
This is Rietveld 408576698