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_strip.h" | 5 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 #include "ui/views/masked_targeter_delegate.h" | 54 #include "ui/views/masked_targeter_delegate.h" |
55 #include "ui/views/mouse_watcher_view_host.h" | 55 #include "ui/views/mouse_watcher_view_host.h" |
56 #include "ui/views/rect_based_targeting_utils.h" | 56 #include "ui/views/rect_based_targeting_utils.h" |
57 #include "ui/views/view_model_utils.h" | 57 #include "ui/views/view_model_utils.h" |
58 #include "ui/views/view_targeter.h" | 58 #include "ui/views/view_targeter.h" |
59 #include "ui/views/widget/root_view.h" | 59 #include "ui/views/widget/root_view.h" |
60 #include "ui/views/widget/widget.h" | 60 #include "ui/views/widget/widget.h" |
61 #include "ui/views/window/non_client_view.h" | 61 #include "ui/views/window/non_client_view.h" |
62 | 62 |
63 #if defined(OS_WIN) | 63 #if defined(OS_WIN) |
64 #include "ui/gfx/win/dpi.h" | 64 #include "ui/gfx/screen_win.h" |
65 #include "ui/gfx/win/hwnd_util.h" | 65 #include "ui/gfx/win/hwnd_util.h" |
66 #include "ui/views/widget/monitor_win.h" | 66 #include "ui/views/widget/monitor_win.h" |
67 #include "ui/views/win/hwnd_util.h" | 67 #include "ui/views/win/hwnd_util.h" |
68 #endif | 68 #endif |
69 | 69 |
70 using base::UserMetricsAction; | 70 using base::UserMetricsAction; |
71 using ui::DropTargetEvent; | 71 using ui::DropTargetEvent; |
72 | 72 |
73 namespace { | 73 namespace { |
74 | 74 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 NewTabButton::~NewTabButton() { | 304 NewTabButton::~NewTabButton() { |
305 if (destroyed_) | 305 if (destroyed_) |
306 *destroyed_ = true; | 306 *destroyed_ = true; |
307 } | 307 } |
308 | 308 |
309 #if defined(OS_WIN) | 309 #if defined(OS_WIN) |
310 void NewTabButton::OnMouseReleased(const ui::MouseEvent& event) { | 310 void NewTabButton::OnMouseReleased(const ui::MouseEvent& event) { |
311 if (event.IsOnlyRightMouseButton()) { | 311 if (event.IsOnlyRightMouseButton()) { |
312 gfx::Point point = event.location(); | 312 gfx::Point point = event.location(); |
313 views::View::ConvertPointToScreen(this, &point); | 313 views::View::ConvertPointToScreen(this, &point); |
314 point = gfx::win::DIPToScreenPoint(point); | 314 point = gfx::ScreenWin::DIPToScreenPoint(point); |
315 bool destroyed = false; | 315 bool destroyed = false; |
316 destroyed_ = &destroyed; | 316 destroyed_ = &destroyed; |
317 gfx::ShowSystemMenuAtPoint(views::HWNDForView(this), point); | 317 gfx::ShowSystemMenuAtPoint(views::HWNDForView(this), point); |
318 if (destroyed) | 318 if (destroyed) |
319 return; | 319 return; |
320 | 320 |
321 destroyed_ = NULL; | 321 destroyed_ = NULL; |
322 SetState(views::CustomButton::STATE_NORMAL); | 322 SetState(views::CustomButton::STATE_NORMAL); |
323 return; | 323 return; |
324 } | 324 } |
(...skipping 2363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2688 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); | 2688 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); |
2689 if (view) | 2689 if (view) |
2690 return view; | 2690 return view; |
2691 } | 2691 } |
2692 Tab* tab = FindTabForEvent(point); | 2692 Tab* tab = FindTabForEvent(point); |
2693 if (tab) | 2693 if (tab) |
2694 return ConvertPointToViewAndGetEventHandler(this, tab, point); | 2694 return ConvertPointToViewAndGetEventHandler(this, tab, point); |
2695 } | 2695 } |
2696 return this; | 2696 return this; |
2697 } | 2697 } |
OLD | NEW |