Commit 10a8d9b5 authored by Robert Liao's avatar Robert Liao Committed by Commit Bot

Make ComboboxModelObserver a base::CheckedObserver

This allows ObserverList checking for ComboboxModel subclasses, which
have also been updated.

BUG=963982

Change-Id: Idc3b8a853261a1afd8f0c9132d34d1a681b10204
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1614756Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Robert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#660616}
parent 249be708
......@@ -88,7 +88,7 @@ class RecentlyUsedFoldersComboModel : public ui::ComboboxModel,
// The index of the original parent folder.
int node_parent_index_;
base::ObserverList<ui::ComboboxModelObserver>::Unchecked observers_;
base::ObserverList<ui::ComboboxModelObserver> observers_;
DISALLOW_COPY_AND_ASSIGN(RecentlyUsedFoldersComboModel);
};
......
......@@ -72,7 +72,7 @@ class AddressComboboxModel : public ui::ComboboxModel {
std::string default_selected_guid_;
// To be called when the data for the given country code was loaded.
base::ObserverList<ui::ComboboxModelObserver>::Unchecked observers_;
base::ObserverList<ui::ComboboxModelObserver> observers_;
DISALLOW_COPY_AND_ASSIGN(AddressComboboxModel);
};
......
......@@ -70,7 +70,7 @@ class RegionComboboxModel : public ui::ComboboxModel {
std::vector<std::pair<std::string, std::string>> regions_;
// To be called when the data for the given country code was loaded.
base::ObserverList<ui::ComboboxModelObserver>::Unchecked observers_;
base::ObserverList<ui::ComboboxModelObserver> observers_;
DISALLOW_COPY_AND_ASSIGN(RegionComboboxModel);
};
......
......@@ -5,6 +5,7 @@
#ifndef UI_BASE_MODELS_COMBOBOX_MODEL_OBSERVER_H_
#define UI_BASE_MODELS_COMBOBOX_MODEL_OBSERVER_H_
#include "base/observer_list_types.h"
#include "ui/base/ui_base_export.h"
namespace ui {
......@@ -12,14 +13,14 @@ namespace ui {
class ComboboxModel;
// Observer for the ComboboxModel.
class UI_BASE_EXPORT ComboboxModelObserver {
class UI_BASE_EXPORT ComboboxModelObserver : public base::CheckedObserver {
public:
// Invoked when |model| has changed in some way. The observer should assume
// everything changed.
virtual void OnComboboxModelChanged(ComboboxModel* model) = 0;
protected:
virtual ~ComboboxModelObserver() {}
~ComboboxModelObserver() override = default;
};
} // namespace ui
......
......@@ -124,7 +124,7 @@ class TestComboboxModel : public ui::ComboboxModel {
observer.OnComboboxModelChanged(this);
}
base::ObserverList<ui::ComboboxModelObserver>::Unchecked observers_;
base::ObserverList<ui::ComboboxModelObserver> observers_;
std::set<int> separators_;
int item_count_ = kItemCount;
......@@ -162,7 +162,7 @@ class VectorComboboxModel : public ui::ComboboxModel {
}
private:
base::ObserverList<ui::ComboboxModelObserver>::Unchecked observers_;
base::ObserverList<ui::ComboboxModelObserver> observers_;
int default_index_ = 0;
std::vector<std::string>* const values_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment