| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <iterator> | 10 #include <iterator> |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 #include "ui/views/masked_targeter_delegate.h" | 66 #include "ui/views/masked_targeter_delegate.h" |
| 67 #include "ui/views/mouse_watcher_view_host.h" | 67 #include "ui/views/mouse_watcher_view_host.h" |
| 68 #include "ui/views/rect_based_targeting_utils.h" | 68 #include "ui/views/rect_based_targeting_utils.h" |
| 69 #include "ui/views/view_model_utils.h" | 69 #include "ui/views/view_model_utils.h" |
| 70 #include "ui/views/view_targeter.h" | 70 #include "ui/views/view_targeter.h" |
| 71 #include "ui/views/widget/root_view.h" | 71 #include "ui/views/widget/root_view.h" |
| 72 #include "ui/views/widget/widget.h" | 72 #include "ui/views/widget/widget.h" |
| 73 #include "ui/views/window/non_client_view.h" | 73 #include "ui/views/window/non_client_view.h" |
| 74 | 74 |
| 75 #if defined(OS_WIN) | 75 #if defined(OS_WIN) |
| 76 #include "ui/gfx/win/dpi.h" | 76 #include "ui/gfx/screen_win.h" |
| 77 #include "ui/gfx/win/hwnd_util.h" | 77 #include "ui/gfx/win/hwnd_util.h" |
| 78 #include "ui/views/widget/monitor_win.h" | 78 #include "ui/views/widget/monitor_win.h" |
| 79 #include "ui/views/win/hwnd_util.h" | 79 #include "ui/views/win/hwnd_util.h" |
| 80 #endif | 80 #endif |
| 81 | 81 |
| 82 using base::UserMetricsAction; | 82 using base::UserMetricsAction; |
| 83 using ui::DropTargetEvent; | 83 using ui::DropTargetEvent; |
| 84 | 84 |
| 85 namespace { | 85 namespace { |
| 86 | 86 |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 NewTabButton::~NewTabButton() { | 343 NewTabButton::~NewTabButton() { |
| 344 if (destroyed_) | 344 if (destroyed_) |
| 345 *destroyed_ = true; | 345 *destroyed_ = true; |
| 346 } | 346 } |
| 347 | 347 |
| 348 #if defined(OS_WIN) | 348 #if defined(OS_WIN) |
| 349 void NewTabButton::OnMouseReleased(const ui::MouseEvent& event) { | 349 void NewTabButton::OnMouseReleased(const ui::MouseEvent& event) { |
| 350 if (event.IsOnlyRightMouseButton()) { | 350 if (event.IsOnlyRightMouseButton()) { |
| 351 gfx::Point point = event.location(); | 351 gfx::Point point = event.location(); |
| 352 views::View::ConvertPointToScreen(this, &point); | 352 views::View::ConvertPointToScreen(this, &point); |
| 353 point = gfx::win::DIPToScreenPoint(point); | 353 point = gfx::ScreenWin::DIPToScreenPoint(point); |
| 354 bool destroyed = false; | 354 bool destroyed = false; |
| 355 destroyed_ = &destroyed; | 355 destroyed_ = &destroyed; |
| 356 gfx::ShowSystemMenuAtPoint(views::HWNDForView(this), point); | 356 gfx::ShowSystemMenuAtPoint(views::HWNDForView(this), point); |
| 357 if (destroyed) | 357 if (destroyed) |
| 358 return; | 358 return; |
| 359 | 359 |
| 360 destroyed_ = NULL; | 360 destroyed_ = NULL; |
| 361 SetState(views::CustomButton::STATE_NORMAL); | 361 SetState(views::CustomButton::STATE_NORMAL); |
| 362 return; | 362 return; |
| 363 } | 363 } |
| (...skipping 2507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2871 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); | 2871 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); |
| 2872 if (view) | 2872 if (view) |
| 2873 return view; | 2873 return view; |
| 2874 } | 2874 } |
| 2875 Tab* tab = FindTabForEvent(point); | 2875 Tab* tab = FindTabForEvent(point); |
| 2876 if (tab) | 2876 if (tab) |
| 2877 return ConvertPointToViewAndGetEventHandler(this, tab, point); | 2877 return ConvertPointToViewAndGetEventHandler(this, tab, point); |
| 2878 } | 2878 } |
| 2879 return this; | 2879 return this; |
| 2880 } | 2880 } |
| OLD | NEW |