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

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

Issue 2906803002: Rename MaximizeMode to TabletMode (Closed)
Patch Set: updated filter Created 3 years, 7 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 24 matching lines...) Expand all
35 #include "ui/events/gestures/gesture_recognizer.h" 35 #include "ui/events/gestures/gesture_recognizer.h"
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" // nogncheck 43 #include "ash/accelerators/accelerator_commands.h" // nogncheck
44 #include "ash/shell.h" // nogncheck 44 #include "ash/shell.h" // nogncheck
45 #include "ash/wm/maximize_mode/maximize_mode_controller.h" // nogncheck 45 #include "ash/wm/tablet_mode/tablet_mode_controller.h" // nogncheck
46 #include "ash/wm/window_state.h" // nogncheck 46 #include "ash/wm/window_state.h" // nogncheck
47 #include "ui/wm/core/coordinate_conversion.h" // nogncheck 47 #include "ui/wm/core/coordinate_conversion.h" // nogncheck
48 #endif 48 #endif
49 49
50 #if defined(USE_AURA) 50 #if defined(USE_AURA)
51 #include "ui/aura/env.h" // nogncheck 51 #include "ui/aura/env.h" // nogncheck
52 #include "ui/aura/window.h" // nogncheck 52 #include "ui/aura/window.h" // nogncheck
53 #include "ui/wm/core/window_modality_controller.h" // nogncheck 53 #include "ui/wm/core/window_modality_controller.h" // nogncheck
54 #endif 54 #endif
55 55
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 InitWindowCreatePoint(); 295 InitWindowCreatePoint();
296 initial_selection_model_.Copy(initial_selection_model); 296 initial_selection_model_.Copy(initial_selection_model);
297 297
298 // Gestures don't automatically do a capture. We don't allow multiple drags at 298 // Gestures don't automatically do a capture. We don't allow multiple drags at
299 // the same time, so we explicitly capture. 299 // the same time, so we explicitly capture.
300 if (event_source == EVENT_SOURCE_TOUCH) 300 if (event_source == EVENT_SOURCE_TOUCH)
301 source_tabstrip_->GetWidget()->SetCapture(source_tabstrip_); 301 source_tabstrip_->GetWidget()->SetCapture(source_tabstrip_);
302 302
303 #if defined(USE_ASH) 303 #if defined(USE_ASH)
304 if (ash::Shell::HasInstance() && ash::Shell::Get() 304 if (ash::Shell::HasInstance() && ash::Shell::Get()
305 ->maximize_mode_controller() 305 ->tablet_mode_controller()
306 ->IsMaximizeModeWindowManagerEnabled()) { 306 ->IsTabletModeWindowManagerEnabled()) {
307 detach_behavior_ = NOT_DETACHABLE; 307 detach_behavior_ = NOT_DETACHABLE;
308 } 308 }
309 #endif 309 #endif
310 } 310 }
311 311
312 // static 312 // static
313 bool TabDragController::IsAttachedTo(const TabStrip* tab_strip) { 313 bool TabDragController::IsAttachedTo(const TabStrip* tab_strip) {
314 return (instance_ && instance_->active() && 314 return (instance_ && instance_->active() &&
315 instance_->attached_tabstrip() == tab_strip); 315 instance_->attached_tabstrip() == tab_strip);
316 } 316 }
(...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after
1804 // TODO(pkotwicz): Fix this properly (crbug.com/358482) 1804 // TODO(pkotwicz): Fix this properly (crbug.com/358482)
1805 for (auto* browser : *BrowserList::GetInstance()) { 1805 for (auto* browser : *BrowserList::GetInstance()) {
1806 if (browser->tab_strip_model()->empty()) 1806 if (browser->tab_strip_model()->empty())
1807 exclude.insert(browser->window()->GetNativeWindow()); 1807 exclude.insert(browser->window()->GetNativeWindow());
1808 } 1808 }
1809 #endif 1809 #endif
1810 base::WeakPtr<TabDragController> ref(weak_factory_.GetWeakPtr()); 1810 base::WeakPtr<TabDragController> ref(weak_factory_.GetWeakPtr());
1811 *window = window_finder_->GetLocalProcessWindowAtPoint(screen_point, exclude); 1811 *window = window_finder_->GetLocalProcessWindowAtPoint(screen_point, exclude);
1812 return ref ? Liveness::ALIVE : Liveness::DELETED; 1812 return ref ? Liveness::ALIVE : Liveness::DELETED;
1813 } 1813 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698