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

Side by Side Diff: ui/aura/shared/root_window_capture_client.cc

Issue 11368010: Move aura shared and desktop classes to the views target. Note that the files don't actually move, … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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/aura/shared/root_window_capture_client.h ('k') | ui/aura/test/aura_test_helper.h » ('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) 2012 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/aura/shared/root_window_capture_client.h"
6
7 #include "ui/aura/root_window.h"
8 #include "ui/aura/window.h"
9
10 namespace aura {
11 namespace shared {
12
13 ////////////////////////////////////////////////////////////////////////////////
14 // RootWindowCaptureClient, public:
15
16 RootWindowCaptureClient::RootWindowCaptureClient(RootWindow* root_window)
17 : root_window_(root_window),
18 capture_window_(NULL) {
19 client::SetCaptureClient(root_window, this);
20 }
21
22 RootWindowCaptureClient::~RootWindowCaptureClient() {
23 client::SetCaptureClient(root_window_, NULL);
24 }
25
26 ////////////////////////////////////////////////////////////////////////////////
27 // RootWindowCaptureClient, client::CaptureClient implementation:
28
29 void RootWindowCaptureClient::SetCapture(Window* window) {
30 if (capture_window_ == window)
31 return;
32 root_window_->gesture_recognizer()->TransferEventsTo(capture_window_, window);
33
34 aura::Window* old_capture_window = capture_window_;
35 capture_window_ = window;
36
37 if (capture_window_)
38 root_window_->SetNativeCapture();
39 else
40 root_window_->ReleaseNativeCapture();
41
42 root_window_->UpdateCapture(old_capture_window, capture_window_);
43 }
44
45 void RootWindowCaptureClient::ReleaseCapture(Window* window) {
46 if (capture_window_ != window)
47 return;
48 SetCapture(NULL);
49 }
50
51 Window* RootWindowCaptureClient::GetCaptureWindow() {
52 return capture_window_;
53 }
54
55 } // namespace shared
56 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/shared/root_window_capture_client.h ('k') | ui/aura/test/aura_test_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698