OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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 "content/browser/web_contents/aura/window_slider.h" | 5 #include "content/browser/web_contents/aura/window_slider.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 } // namespace | 45 } // namespace |
46 | 46 |
47 WindowSlider::WindowSlider(Delegate* delegate, | 47 WindowSlider::WindowSlider(Delegate* delegate, |
48 aura::Window* event_window, | 48 aura::Window* event_window, |
49 aura::Window* owner) | 49 aura::Window* owner) |
50 : delegate_(delegate), | 50 : delegate_(delegate), |
51 event_window_(event_window), | 51 event_window_(event_window), |
52 owner_(owner), | 52 owner_(owner), |
53 active_animator_(NULL), | 53 active_animator_(NULL), |
54 delta_x_(0.f), | 54 delta_x_(0.f), |
55 weak_factory_(this), | |
56 active_start_threshold_(0.f), | 55 active_start_threshold_(0.f), |
57 start_threshold_touchscreen_(content::GetOverscrollConfig( | 56 start_threshold_touchscreen_(content::GetOverscrollConfig( |
58 content::OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START_TOUCHSCREEN)), | 57 content::OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START_TOUCHSCREEN)), |
59 start_threshold_touchpad_(content::GetOverscrollConfig( | 58 start_threshold_touchpad_(content::GetOverscrollConfig( |
60 content::OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START_TOUCHPAD)), | 59 content::OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START_TOUCHPAD)), |
61 complete_threshold_(content::GetOverscrollConfig( | 60 complete_threshold_(content::GetOverscrollConfig( |
62 content::OVERSCROLL_CONFIG_HORIZ_THRESHOLD_COMPLETE)) { | 61 content::OVERSCROLL_CONFIG_HORIZ_THRESHOLD_COMPLETE)), |
| 62 weak_factory_(this) { |
63 event_window_->AddPreTargetHandler(this); | 63 event_window_->AddPreTargetHandler(this); |
64 | 64 |
65 event_window_->AddObserver(this); | 65 event_window_->AddObserver(this); |
66 owner_->AddObserver(this); | 66 owner_->AddObserver(this); |
67 } | 67 } |
68 | 68 |
69 WindowSlider::~WindowSlider() { | 69 WindowSlider::~WindowSlider() { |
70 if (event_window_) { | 70 if (event_window_) { |
71 event_window_->RemovePreTargetHandler(this); | 71 event_window_->RemovePreTargetHandler(this); |
72 event_window_->RemoveObserver(this); | 72 event_window_->RemoveObserver(this); |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 } else if (window == owner_) { | 300 } else if (window == owner_) { |
301 window->RemoveObserver(this); | 301 window->RemoveObserver(this); |
302 owner_ = NULL; | 302 owner_ = NULL; |
303 delete this; | 303 delete this; |
304 } else { | 304 } else { |
305 NOTREACHED(); | 305 NOTREACHED(); |
306 } | 306 } |
307 } | 307 } |
308 | 308 |
309 } // namespace content | 309 } // namespace content |
OLD | NEW |