| 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 "ui/views/touchui/touch_selection_controller_impl.h" | 5 #include "ui/views/touchui/touch_selection_controller_impl.h" |
| 6 | 6 |
| 7 #include "base/time.h" | 7 #include "base/time.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "grit/ui_strings.h" | 9 #include "grit/ui_strings.h" |
| 10 #include "third_party/skia/include/effects/SkGradientShader.h" | 10 #include "third_party/skia/include/effects/SkGradientShader.h" |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 total_width += button_size.width() + kContextMenuPadding; | 304 total_width += button_size.width() + kContextMenuPadding; |
| 305 if (height < button_size.height()) | 305 if (height < button_size.height()) |
| 306 height = button_size.height(); | 306 height = button_size.height(); |
| 307 } | 307 } |
| 308 } | 308 } |
| 309 gfx::Rect widget_bounds(position.x() - total_width / 2, | 309 gfx::Rect widget_bounds(position.x() - total_width / 2, |
| 310 position.y() - height, | 310 position.y() - height, |
| 311 total_width, | 311 total_width, |
| 312 height); | 312 height); |
| 313 gfx::Rect monitor_bounds = | 313 gfx::Rect monitor_bounds = |
| 314 gfx::Screen::GetMonitorAreaNearestPoint(position); | 314 gfx::Screen::GetMonitorNearestPoint(position).bounds(); |
| 315 widget_->SetBounds(widget_bounds.AdjustToFit(monitor_bounds)); | 315 widget_->SetBounds(widget_bounds.AdjustToFit(monitor_bounds)); |
| 316 Layout(); | 316 Layout(); |
| 317 } | 317 } |
| 318 | 318 |
| 319 scoped_ptr<Widget> widget_; | 319 scoped_ptr<Widget> widget_; |
| 320 TouchSelectionControllerImpl* controller_; | 320 TouchSelectionControllerImpl* controller_; |
| 321 | 321 |
| 322 DISALLOW_COPY_AND_ASSIGN(TouchContextMenuView); | 322 DISALLOW_COPY_AND_ASSIGN(TouchContextMenuView); |
| 323 }; | 323 }; |
| 324 | 324 |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 bool TouchSelectionControllerImpl::IsSelectionHandle2Visible() { | 488 bool TouchSelectionControllerImpl::IsSelectionHandle2Visible() { |
| 489 return selection_handle_2_->visible(); | 489 return selection_handle_2_->visible(); |
| 490 } | 490 } |
| 491 | 491 |
| 492 TouchSelectionController* TouchSelectionController::create( | 492 TouchSelectionController* TouchSelectionController::create( |
| 493 TouchSelectionClientView* client_view) { | 493 TouchSelectionClientView* client_view) { |
| 494 return new TouchSelectionControllerImpl(client_view); | 494 return new TouchSelectionControllerImpl(client_view); |
| 495 } | 495 } |
| 496 | 496 |
| 497 } // namespace views | 497 } // namespace views |
| OLD | NEW |