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

Side by Side Diff: ui/views/touchui/touch_selection_controller_impl.cc

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/test/views_test_base.cc ('k') | ui/views/widget/native_widget_aura.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 "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
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
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
OLDNEW
« no previous file with comments | « ui/views/test/views_test_base.cc ('k') | ui/views/widget/native_widget_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698