OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #import "ui/views/cocoa/cocoa_mouse_capture.h" | 5 #import "ui/views/cocoa/cocoa_mouse_capture.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" |
10 #import "ui/views/cocoa/cocoa_mouse_capture_delegate.h" | 11 #import "ui/views/cocoa/cocoa_mouse_capture_delegate.h" |
11 | 12 |
12 namespace views { | 13 namespace views { |
13 | 14 |
14 // The ActiveEventTap is a RAII handle on the resources being used to capture | 15 // The ActiveEventTap is a RAII handle on the resources being used to capture |
15 // events. There is either 0 or 1 active instance of this class. If a second | 16 // events. There is either 0 or 1 active instance of this class. If a second |
16 // instance is created, it will destroy the other instance before returning from | 17 // instance is created, it will destroy the other instance before returning from |
17 // its constructor. | 18 // its constructor. |
18 class CocoaMouseCapture::ActiveEventTap { | 19 class CocoaMouseCapture::ActiveEventTap { |
19 public: | 20 public: |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 78 |
78 CocoaMouseCapture::~CocoaMouseCapture() { | 79 CocoaMouseCapture::~CocoaMouseCapture() { |
79 } | 80 } |
80 | 81 |
81 void CocoaMouseCapture::OnOtherClientGotCapture() { | 82 void CocoaMouseCapture::OnOtherClientGotCapture() { |
82 DCHECK(active_handle_); | 83 DCHECK(active_handle_); |
83 active_handle_.reset(); | 84 active_handle_.reset(); |
84 } | 85 } |
85 | 86 |
86 } // namespace views | 87 } // namespace views |
OLD | NEW |