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

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

Issue 425363002: Moving coordinate conversion methods from ash/wm to ui/wm. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More fixes Created 6 years, 4 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
« no previous file with comments | « ash/wm/workspace/workspace_window_resizer.cc ('k') | ui/wm/core/coordinate_conversion.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ash/accelerators/accelerator_commands.h" 10 #include "ash/accelerators/accelerator_commands.h"
11 #include "ash/wm/coordinate_conversion.h"
12 #include "ash/wm/window_state.h" 11 #include "ash/wm/window_state.h"
13 #include "base/auto_reset.h" 12 #include "base/auto_reset.h"
14 #include "base/callback.h" 13 #include "base/callback.h"
15 #include "base/i18n/rtl.h" 14 #include "base/i18n/rtl.h"
16 #include "chrome/browser/chrome_notification_types.h" 15 #include "chrome/browser/chrome_notification_types.h"
17 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/ui/browser_list.h" 17 #include "chrome/browser/ui/browser_list.h"
19 #include "chrome/browser/ui/browser_window.h" 18 #include "chrome/browser/ui/browser_window.h"
20 #include "chrome/browser/ui/tabs/tab_strip_model.h" 19 #include "chrome/browser/ui/tabs/tab_strip_model.h"
21 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" 20 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h"
(...skipping 12 matching lines...) Expand all
34 #include "extensions/browser/extension_function_dispatcher.h" 33 #include "extensions/browser/extension_function_dispatcher.h"
35 #include "ui/aura/env.h" 34 #include "ui/aura/env.h"
36 #include "ui/aura/window.h" 35 #include "ui/aura/window.h"
37 #include "ui/events/event_constants.h" 36 #include "ui/events/event_constants.h"
38 #include "ui/events/gestures/gesture_recognizer.h" 37 #include "ui/events/gestures/gesture_recognizer.h"
39 #include "ui/gfx/geometry/point_conversions.h" 38 #include "ui/gfx/geometry/point_conversions.h"
40 #include "ui/gfx/screen.h" 39 #include "ui/gfx/screen.h"
41 #include "ui/views/focus/view_storage.h" 40 #include "ui/views/focus/view_storage.h"
42 #include "ui/views/widget/root_view.h" 41 #include "ui/views/widget/root_view.h"
43 #include "ui/views/widget/widget.h" 42 #include "ui/views/widget/widget.h"
43 #include "ui/wm/core/coordinate_conversion.h"
44 #include "ui/wm/core/window_modality_controller.h" 44 #include "ui/wm/core/window_modality_controller.h"
45 45
46 using base::UserMetricsAction; 46 using base::UserMetricsAction;
47 using content::OpenURLParams; 47 using content::OpenURLParams;
48 using content::WebContents; 48 using content::WebContents;
49 49
50 // If non-null there is a drag underway. 50 // If non-null there is a drag underway.
51 static TabDragController* instance_ = NULL; 51 static TabDragController* instance_ = NULL;
52 52
53 namespace { 53 namespace {
(...skipping 1653 matching lines...) Expand 10 before | Expand all | Expand 10 after
1707 views::Widget* widget = GetAttachedBrowserWidget(); 1707 views::Widget* widget = GetAttachedBrowserWidget();
1708 DCHECK(widget); 1708 DCHECK(widget);
1709 aura::Window* widget_window = widget->GetNativeWindow(); 1709 aura::Window* widget_window = widget->GetNativeWindow();
1710 DCHECK(widget_window->GetRootWindow()); 1710 DCHECK(widget_window->GetRootWindow());
1711 gfx::PointF touch_point_f; 1711 gfx::PointF touch_point_f;
1712 bool got_touch_point = ui::GestureRecognizer::Get()-> 1712 bool got_touch_point = ui::GestureRecognizer::Get()->
1713 GetLastTouchPointForTarget(widget_window, &touch_point_f); 1713 GetLastTouchPointForTarget(widget_window, &touch_point_f);
1714 // TODO(tdresser): Switch to using gfx::PointF. See crbug.com/337824. 1714 // TODO(tdresser): Switch to using gfx::PointF. See crbug.com/337824.
1715 gfx::Point touch_point = gfx::ToFlooredPoint(touch_point_f); 1715 gfx::Point touch_point = gfx::ToFlooredPoint(touch_point_f);
1716 DCHECK(got_touch_point); 1716 DCHECK(got_touch_point);
1717 ash::wm::ConvertPointToScreen(widget_window->GetRootWindow(), &touch_point); 1717 wm::ConvertPointToScreen(widget_window->GetRootWindow(), &touch_point);
1718 return touch_point; 1718 return touch_point;
1719 } 1719 }
1720 1720
1721 return screen_->GetCursorScreenPoint(); 1721 return screen_->GetCursorScreenPoint();
1722 } 1722 }
1723 1723
1724 gfx::Vector2d TabDragController::GetWindowOffset( 1724 gfx::Vector2d TabDragController::GetWindowOffset(
1725 const gfx::Point& point_in_screen) { 1725 const gfx::Point& point_in_screen) {
1726 TabStrip* owning_tabstrip = attached_tabstrip_ ? 1726 TabStrip* owning_tabstrip = attached_tabstrip_ ?
1727 attached_tabstrip_ : source_tabstrip_; 1727 attached_tabstrip_ : source_tabstrip_;
(...skipping 26 matching lines...) Expand all
1754 it != browser_list->end(); ++it) { 1754 it != browser_list->end(); ++it) {
1755 if ((*it)->tab_strip_model()->empty()) 1755 if ((*it)->tab_strip_model()->empty())
1756 exclude.insert((*it)->window()->GetNativeWindow()); 1756 exclude.insert((*it)->window()->GetNativeWindow());
1757 } 1757 }
1758 #endif 1758 #endif
1759 return GetLocalProcessWindowAtPoint(host_desktop_type_, 1759 return GetLocalProcessWindowAtPoint(host_desktop_type_,
1760 screen_point, 1760 screen_point,
1761 exclude); 1761 exclude);
1762 1762
1763 } 1763 }
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace_window_resizer.cc ('k') | ui/wm/core/coordinate_conversion.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698