| OLD | NEW |
| 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 "chrome/browser/ui/views/tabs/tab_drag_controller.h" | 5 #include "chrome/browser/ui/views/tabs/tab_drag_controller.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 move_loop_widget_(NULL), | 224 move_loop_widget_(NULL), |
| 225 is_mutating_(false), | 225 is_mutating_(false), |
| 226 attach_x_(-1), | 226 attach_x_(-1), |
| 227 attach_index_(-1), | 227 attach_index_(-1), |
| 228 weak_factory_(this) { | 228 weak_factory_(this) { |
| 229 instance_ = this; | 229 instance_ = this; |
| 230 | 230 |
| 231 #if defined(USE_AURA) | 231 #if defined(USE_AURA) |
| 232 content::ServiceManagerConnection* service_manager_connection = | 232 content::ServiceManagerConnection* service_manager_connection = |
| 233 content::ServiceManagerConnection::GetForProcess(); | 233 content::ServiceManagerConnection::GetForProcess(); |
| 234 if (service_manager_connection && shell::ShellIsRemote()) | 234 if (service_manager_connection && service_manager::ServiceManagerIsRemote()) |
| 235 window_finder_.reset(new WindowFinderMus); | 235 window_finder_.reset(new WindowFinderMus); |
| 236 else | 236 else |
| 237 #endif | 237 #endif |
| 238 window_finder_.reset(new WindowFinder); | 238 window_finder_.reset(new WindowFinder); |
| 239 } | 239 } |
| 240 | 240 |
| 241 TabDragController::~TabDragController() { | 241 TabDragController::~TabDragController() { |
| 242 views::ViewStorage::GetInstance()->RemoveView(old_focused_view_id_); | 242 views::ViewStorage::GetInstance()->RemoveView(old_focused_view_id_); |
| 243 | 243 |
| 244 if (instance_ == this) | 244 if (instance_ == this) |
| (...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1846 // TODO(pkotwicz): Fix this properly (crbug.com/358482) | 1846 // TODO(pkotwicz): Fix this properly (crbug.com/358482) |
| 1847 for (auto* browser : *BrowserList::GetInstance()) { | 1847 for (auto* browser : *BrowserList::GetInstance()) { |
| 1848 if (browser->tab_strip_model()->empty()) | 1848 if (browser->tab_strip_model()->empty()) |
| 1849 exclude.insert(browser->window()->GetNativeWindow()); | 1849 exclude.insert(browser->window()->GetNativeWindow()); |
| 1850 } | 1850 } |
| 1851 #endif | 1851 #endif |
| 1852 base::WeakPtr<TabDragController> ref(weak_factory_.GetWeakPtr()); | 1852 base::WeakPtr<TabDragController> ref(weak_factory_.GetWeakPtr()); |
| 1853 *window = window_finder_->GetLocalProcessWindowAtPoint(screen_point, exclude); | 1853 *window = window_finder_->GetLocalProcessWindowAtPoint(screen_point, exclude); |
| 1854 return ref ? Liveness::ALIVE : Liveness::DELETED; | 1854 return ref ? Liveness::ALIVE : Liveness::DELETED; |
| 1855 } | 1855 } |
| OLD | NEW |