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

Side by Side Diff: ui/views/widget/widget.cc

Issue 1059383003: Make sure observers are not nullptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « ui/gfx/display_change_notifier_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/widget/widget.h" 5 #include "ui/views/widget/widget.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 382
383 gfx::NativeView Widget::GetNativeView() const { 383 gfx::NativeView Widget::GetNativeView() const {
384 return native_widget_->GetNativeView(); 384 return native_widget_->GetNativeView();
385 } 385 }
386 386
387 gfx::NativeWindow Widget::GetNativeWindow() const { 387 gfx::NativeWindow Widget::GetNativeWindow() const {
388 return native_widget_->GetNativeWindow(); 388 return native_widget_->GetNativeWindow();
389 } 389 }
390 390
391 void Widget::AddObserver(WidgetObserver* observer) { 391 void Widget::AddObserver(WidgetObserver* observer) {
392 // TODO(oshima): Remove this CHECK once crbug.com/471649 is resolved.
sadrul 2015/04/08 19:12:33 I actually like this check. Maybe just always keep
oshima 2015/04/08 19:17:10 Sure. I just updated the comment to give more cont
danakj 2015/04/08 20:03:45 Why CHECK instead of DCHECK? It adds code/strings
393 CHECK(observer);
392 observers_.AddObserver(observer); 394 observers_.AddObserver(observer);
393 } 395 }
394 396
395 void Widget::RemoveObserver(WidgetObserver* observer) { 397 void Widget::RemoveObserver(WidgetObserver* observer) {
396 observers_.RemoveObserver(observer); 398 observers_.RemoveObserver(observer);
397 } 399 }
398 400
399 bool Widget::HasObserver(const WidgetObserver* observer) const { 401 bool Widget::HasObserver(const WidgetObserver* observer) const {
400 return observers_.HasObserver(observer); 402 return observers_.HasObserver(observer);
401 } 403 }
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1536 1538
1537 //////////////////////////////////////////////////////////////////////////////// 1539 ////////////////////////////////////////////////////////////////////////////////
1538 // internal::NativeWidgetPrivate, NativeWidget implementation: 1540 // internal::NativeWidgetPrivate, NativeWidget implementation:
1539 1541
1540 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1542 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1541 return this; 1543 return this;
1542 } 1544 }
1543 1545
1544 } // namespace internal 1546 } // namespace internal
1545 } // namespace views 1547 } // namespace views
OLDNEW
« no previous file with comments | « ui/gfx/display_change_notifier_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698