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

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

Issue 24469006: Fixing crash Report - Magic Signature: views::View::ConvertPointToScreen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed - git what are you doing today? Created 7 years, 2 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/time.h" 7 #include "base/time/time.h"
8 #include "grit/ui_resources.h" 8 #include "grit/ui_resources.h"
9 #include "grit/ui_strings.h" 9 #include "grit/ui_strings.h"
10 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 } 415 }
416 416
417 void TouchSelectionControllerImpl::ExecuteCommand(int command_id, 417 void TouchSelectionControllerImpl::ExecuteCommand(int command_id,
418 int event_flags) { 418 int event_flags) {
419 HideContextMenu(); 419 HideContextMenu();
420 client_view_->ExecuteCommand(command_id, event_flags); 420 client_view_->ExecuteCommand(command_id, event_flags);
421 } 421 }
422 422
423 void TouchSelectionControllerImpl::OpenContextMenu() { 423 void TouchSelectionControllerImpl::OpenContextMenu() {
424 // Context menu should appear centered on top of the selected region. 424 // Context menu should appear centered on top of the selected region.
425 gfx::Point anchor(context_menu_->anchor_rect().CenterPoint().x(), 425 const gfx::Rect& rect = context_menu_->GetAnchorRect();
msw 2013/09/27 21:21:53 I don't think using a ref is correct here, since t
Mr4D (OOO till 08-26) 2013/09/27 22:52:21 Done.
426 context_menu_->anchor_rect().y()); 426 gfx::Point anchor(rect.CenterPoint().x(), rect.y());
msw 2013/09/27 21:21:53 nit: const
Mr4D (OOO till 08-26) 2013/09/27 22:52:21 Done.
427 HideContextMenu(); 427 HideContextMenu();
428 client_view_->OpenContextMenu(anchor); 428 client_view_->OpenContextMenu(anchor);
429 } 429 }
430 430
431 void TouchSelectionControllerImpl::OnMenuClosed(TouchEditingMenuView* menu) { 431 void TouchSelectionControllerImpl::OnMenuClosed(TouchEditingMenuView* menu) {
432 if (menu == context_menu_) 432 if (menu == context_menu_)
433 context_menu_ = NULL; 433 context_menu_ = NULL;
434 } 434 }
435 435
436 void TouchSelectionControllerImpl::OnWidgetClosing(Widget* widget) { 436 void TouchSelectionControllerImpl::OnWidgetClosing(Widget* widget) {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 } 534 }
535 535
536 ui::TouchSelectionController* ViewsTouchSelectionControllerFactory::create( 536 ui::TouchSelectionController* ViewsTouchSelectionControllerFactory::create(
537 ui::TouchEditable* client_view) { 537 ui::TouchEditable* client_view) {
538 if (switches::IsTouchEditingEnabled()) 538 if (switches::IsTouchEditingEnabled())
539 return new views::TouchSelectionControllerImpl(client_view); 539 return new views::TouchSelectionControllerImpl(client_view);
540 return NULL; 540 return NULL;
541 } 541 }
542 542
543 } // namespace views 543 } // namespace views
OLDNEW
« ui/views/bubble/bubble_delegate_unittest.cc ('K') | « ui/views/bubble/tray_bubble_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698