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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 paint.setXfermodeMode(SkXfermode::kSrc_Mode); | 266 paint.setXfermodeMode(SkXfermode::kSrc_Mode); |
267 | 267 |
268 canvas->DrawRect(GetLocalBounds(), paint); | 268 canvas->DrawRect(GetLocalBounds(), paint); |
269 #else | 269 #else |
270 canvas->DrawColor(SkColorSetRGB(210, 225, 246), | 270 canvas->DrawColor(SkColorSetRGB(210, 225, 246), |
271 SkXfermode::kSrc_Mode); | 271 SkXfermode::kSrc_Mode); |
272 #endif | 272 #endif |
273 } | 273 } |
274 | 274 |
275 // Overridden from ButtonListener: | 275 // Overridden from ButtonListener: |
276 virtual void ButtonPressed(Button* sender, | 276 virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE { |
277 const views::Event& event) OVERRIDE { | |
278 controller_->ExecuteCommand(sender->tag()); | 277 controller_->ExecuteCommand(sender->tag()); |
279 } | 278 } |
280 | 279 |
281 private: | 280 private: |
282 // Queries the client view for what elements to show in the menu and sizes | 281 // Queries the client view for what elements to show in the menu and sizes |
283 // the menu appropriately. | 282 // the menu appropriately. |
284 void RefreshButtonsAndSetWidgetPosition(const gfx::Point& position) { | 283 void RefreshButtonsAndSetWidgetPosition(const gfx::Point& position) { |
285 RemoveAllChildViews(true); | 284 RemoveAllChildViews(true); |
286 int total_width = 0; | 285 int total_width = 0; |
287 int height = 0; | 286 int height = 0; |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 bool TouchSelectionControllerImpl::IsSelectionHandle2Visible() { | 487 bool TouchSelectionControllerImpl::IsSelectionHandle2Visible() { |
489 return selection_handle_2_->visible(); | 488 return selection_handle_2_->visible(); |
490 } | 489 } |
491 | 490 |
492 TouchSelectionController* TouchSelectionController::create( | 491 TouchSelectionController* TouchSelectionController::create( |
493 TouchSelectionClientView* client_view) { | 492 TouchSelectionClientView* client_view) { |
494 return new TouchSelectionControllerImpl(client_view); | 493 return new TouchSelectionControllerImpl(client_view); |
495 } | 494 } |
496 | 495 |
497 } // namespace views | 496 } // namespace views |
OLD | NEW |