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

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

Issue 12529012: Context menu on views must show on mouse down for non-WIN. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/widget/widget_deletion_observer.h ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 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 "ui/views/widget/widget_deletion_observer.h"
6
7 #include "ui/views/widget/widget.h"
8
9 namespace views {
10
11 WidgetDeletionObserver::WidgetDeletionObserver(Widget* widget)
12 : widget_(widget) {
13 if (widget_)
14 widget_->AddObserver(this);
15 }
16
17 WidgetDeletionObserver::~WidgetDeletionObserver() {
18 CleanupWidget();
19 }
20
21 void WidgetDeletionObserver::OnWidgetDestroying(Widget* widget) {
22 CleanupWidget();
23 }
24
25 void WidgetDeletionObserver::CleanupWidget() {
26 if (widget_) {
27 widget_->RemoveObserver(this);
28 widget_ = NULL;
29 }
30 }
31
32 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/widget_deletion_observer.h ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698