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

Side by Side Diff: ui/views/controls/menu/submenu_view.cc

Issue 10825254: Remove views::KeyEvent, replacing uses of it with ui::KeyEvent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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/controls/menu/submenu_view.h ('k') | ui/views/controls/scroll_view.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/controls/menu/submenu_view.h" 5 #include "ui/views/controls/menu/submenu_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "ui/base/accessibility/accessible_view_state.h" 10 #include "ui/base/accessibility/accessible_view_state.h"
11 #include "ui/base/event.h"
11 #include "ui/gfx/canvas.h" 12 #include "ui/gfx/canvas.h"
12 #include "ui/views/controls/menu/menu_config.h" 13 #include "ui/views/controls/menu/menu_config.h"
13 #include "ui/views/controls/menu/menu_controller.h" 14 #include "ui/views/controls/menu/menu_controller.h"
14 #include "ui/views/controls/menu/menu_host.h" 15 #include "ui/views/controls/menu/menu_host.h"
15 #include "ui/views/controls/menu/menu_scroll_view_container.h" 16 #include "ui/views/controls/menu/menu_scroll_view_container.h"
16 #include "ui/views/widget/root_view.h" 17 #include "ui/views/widget/root_view.h"
17 #include "ui/views/widget/widget.h" 18 #include "ui/views/widget/widget.h"
18 19
19 namespace { 20 namespace {
20 21
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 void SubmenuView::Hide() { 323 void SubmenuView::Hide() {
323 if (host_) 324 if (host_)
324 host_->HideMenuHost(); 325 host_->HideMenuHost();
325 } 326 }
326 327
327 void SubmenuView::ReleaseCapture() { 328 void SubmenuView::ReleaseCapture() {
328 if (host_) 329 if (host_)
329 host_->ReleaseMenuHostCapture(); 330 host_->ReleaseMenuHostCapture();
330 } 331 }
331 332
332 bool SubmenuView::SkipDefaultKeyEventProcessing(const views::KeyEvent& e) { 333 bool SubmenuView::SkipDefaultKeyEventProcessing(const ui::KeyEvent& e) {
333 return views::FocusManager::IsTabTraversalKeyEvent(e); 334 return views::FocusManager::IsTabTraversalKeyEvent(e);
334 } 335 }
335 336
336 MenuItemView* SubmenuView::GetMenuItem() const { 337 MenuItemView* SubmenuView::GetMenuItem() const {
337 return parent_menu_item_; 338 return parent_menu_item_;
338 } 339 }
339 340
340 void SubmenuView::SetDropMenuItem(MenuItemView* item, 341 void SubmenuView::SetDropMenuItem(MenuItemView* item,
341 MenuDelegate::DropPosition position) { 342 MenuDelegate::DropPosition position) {
342 if (drop_item_ == item && drop_position_ == position) 343 if (drop_item_ == item && drop_position_ == position)
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 int y = vis_bounds.y() - static_cast<int>(dy); 431 int y = vis_bounds.y() - static_cast<int>(dy);
431 // clamp y to [0, full_height - vis_height) 432 // clamp y to [0, full_height - vis_height)
432 y = std::max(y, 0); 433 y = std::max(y, 0);
433 y = std::min(y, full_bounds.height() - vis_bounds.height() - 1); 434 y = std::min(y, full_bounds.height() - vis_bounds.height() - 1);
434 gfx::Rect new_vis_bounds(x, y, vis_bounds.width(), vis_bounds.height()); 435 gfx::Rect new_vis_bounds(x, y, vis_bounds.width(), vis_bounds.height());
435 if (new_vis_bounds != vis_bounds) 436 if (new_vis_bounds != vis_bounds)
436 ScrollRectToVisible(new_vis_bounds); 437 ScrollRectToVisible(new_vis_bounds);
437 } 438 }
438 439
439 } // namespace views 440 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/submenu_view.h ('k') | ui/views/controls/scroll_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698