Skip to content

Commit

Permalink
Remove unnecessary DCHECK
Browse files Browse the repository at this point in the history
TBR=dmichael@chromium.org

Review URL: https://codereview.chromium.org/17076014

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207479 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
mukai@chromium.org committed Jun 20, 2013
1 parent 7a11d3a commit a0f4cb9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ui/message_center/views/notifier_settings_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,9 @@ class NotifierSettingsView::NotifierButton : public views::CustomButton,

NotifierSettingsView::NotifierSettingsView(NotifierSettingsProvider* provider)
: provider_(provider) {
DCHECK(provider_);
provider_->AddObserver(this);
// |provider_| may be NULL in tests.
if (provider_)
provider_->AddObserver(this);

set_focusable(true);
set_focus_border(NULL);
Expand Down Expand Up @@ -251,7 +252,8 @@ NotifierSettingsView::NotifierSettingsView(NotifierSettingsProvider* provider)
contents_view->AddChildView(new EntryView(top_label));

std::vector<Notifier*> notifiers;
provider_->GetNotifierList(&notifiers);
if (provider_)
provider_->GetNotifierList(&notifiers);
views::View* first_view = NULL;
views::View* last_view = NULL;
for (size_t i = 0; i < notifiers.size(); ++i) {
Expand All @@ -272,7 +274,9 @@ NotifierSettingsView::NotifierSettingsView(NotifierSettingsProvider* provider)
}

NotifierSettingsView::~NotifierSettingsView() {
provider_->RemoveObserver(this);
// |provider_| may be NULL in tests.
if (provider_)
provider_->RemoveObserver(this);
}

bool NotifierSettingsView::IsScrollable() {
Expand Down

0 comments on commit a0f4cb9

Please sign in to comment.