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

Side by Side Diff: chrome/browser/ui/views/tabs/tab_drag_controller.cc

Issue 2113053003: Moves Shell::maximize_mode_controller() to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: order Created 4 years, 5 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
OLDNEW
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 25 matching lines...) Expand all
36 #include "ui/gfx/geometry/point_conversions.h" 36 #include "ui/gfx/geometry/point_conversions.h"
37 #include "ui/views/event_monitor.h" 37 #include "ui/views/event_monitor.h"
38 #include "ui/views/focus/view_storage.h" 38 #include "ui/views/focus/view_storage.h"
39 #include "ui/views/widget/root_view.h" 39 #include "ui/views/widget/root_view.h"
40 #include "ui/views/widget/widget.h" 40 #include "ui/views/widget/widget.h"
41 41
42 #if defined(USE_ASH) 42 #if defined(USE_ASH)
43 #include "ash/accelerators/accelerator_commands.h" 43 #include "ash/accelerators/accelerator_commands.h"
44 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" 44 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
45 #include "ash/common/wm/window_state.h" 45 #include "ash/common/wm/window_state.h"
46 #include "ash/shell.h" 46 #include "ash/common/wm_shell.h"
47 #include "ash/wm/window_state_aura.h" 47 #include "ash/wm/window_state_aura.h"
48 #include "ui/wm/core/coordinate_conversion.h" 48 #include "ui/wm/core/coordinate_conversion.h"
49 #endif 49 #endif
50 50
51 #if defined(USE_AURA) 51 #if defined(USE_AURA)
52 #include "ui/aura/env.h" 52 #include "ui/aura/env.h"
53 #include "ui/aura/window.h" 53 #include "ui/aura/window.h"
54 #include "ui/wm/core/window_modality_controller.h" 54 #include "ui/wm/core/window_modality_controller.h"
55 #endif 55 #endif
56 56
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 } 302 }
303 InitWindowCreatePoint(); 303 InitWindowCreatePoint();
304 initial_selection_model_.Copy(initial_selection_model); 304 initial_selection_model_.Copy(initial_selection_model);
305 305
306 // Gestures don't automatically do a capture. We don't allow multiple drags at 306 // Gestures don't automatically do a capture. We don't allow multiple drags at
307 // the same time, so we explicitly capture. 307 // the same time, so we explicitly capture.
308 if (event_source == EVENT_SOURCE_TOUCH) 308 if (event_source == EVENT_SOURCE_TOUCH)
309 source_tabstrip_->GetWidget()->SetCapture(source_tabstrip_); 309 source_tabstrip_->GetWidget()->SetCapture(source_tabstrip_);
310 310
311 #if defined(USE_ASH) 311 #if defined(USE_ASH)
312 if (ash::Shell::HasInstance() && 312 if (ash::WmShell::HasInstance() &&
313 ash::Shell::GetInstance()->maximize_mode_controller()-> 313 ash::WmShell::Get()
314 IsMaximizeModeWindowManagerEnabled()) { 314 ->maximize_mode_controller()
315 ->IsMaximizeModeWindowManagerEnabled()) {
315 detach_behavior_ = NOT_DETACHABLE; 316 detach_behavior_ = NOT_DETACHABLE;
316 } 317 }
317 #endif 318 #endif
318 } 319 }
319 320
320 // static 321 // static
321 bool TabDragController::IsAttachedTo(const TabStrip* tab_strip) { 322 bool TabDragController::IsAttachedTo(const TabStrip* tab_strip) {
322 return (instance_ && instance_->active() && 323 return (instance_ && instance_->active() &&
323 instance_->attached_tabstrip() == tab_strip); 324 instance_->attached_tabstrip() == tab_strip);
324 } 325 }
(...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after
1807 // TODO(pkotwicz): Fix this properly (crbug.com/358482) 1808 // TODO(pkotwicz): Fix this properly (crbug.com/358482)
1808 for (auto* browser : *BrowserList::GetInstance()) { 1809 for (auto* browser : *BrowserList::GetInstance()) {
1809 if (browser->tab_strip_model()->empty()) 1810 if (browser->tab_strip_model()->empty())
1810 exclude.insert(browser->window()->GetNativeWindow()); 1811 exclude.insert(browser->window()->GetNativeWindow());
1811 } 1812 }
1812 #endif 1813 #endif
1813 base::WeakPtr<TabDragController> ref(weak_factory_.GetWeakPtr()); 1814 base::WeakPtr<TabDragController> ref(weak_factory_.GetWeakPtr());
1814 *window = window_finder_->GetLocalProcessWindowAtPoint(screen_point, exclude); 1815 *window = window_finder_->GetLocalProcessWindowAtPoint(screen_point, exclude);
1815 return ref ? Liveness::ALIVE : Liveness::DELETED; 1816 return ref ? Liveness::ALIVE : Liveness::DELETED;
1816 } 1817 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698