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

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

Issue 275183002: patch from issue 218843002 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 years, 7 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
« no previous file with comments | « ui/views/controls/menu/submenu_view.h ('k') | ui/views/controls/separator.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/accessibility/ax_view_state.h" 10 #include "ui/accessibility/ax_view_state.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // Inherit most of the state from the parent menu item, except the role. 170 // Inherit most of the state from the parent menu item, except the role.
171 if (GetMenuItem()) 171 if (GetMenuItem())
172 GetMenuItem()->GetAccessibleState(state); 172 GetMenuItem()->GetAccessibleState(state);
173 state->role = ui::AX_ROLE_MENU_LIST_POPUP; 173 state->role = ui::AX_ROLE_MENU_LIST_POPUP;
174 } 174 }
175 175
176 ui::TextInputClient* SubmenuView::GetTextInputClient() { 176 ui::TextInputClient* SubmenuView::GetTextInputClient() {
177 return &prefix_selector_; 177 return &prefix_selector_;
178 } 178 }
179 179
180 void SubmenuView::PaintChildren(gfx::Canvas* canvas) { 180 void SubmenuView::PaintChildren(gfx::Canvas* canvas,
181 View::PaintChildren(canvas); 181 const views::CullSet& cull_set) {
182 View::PaintChildren(canvas, cull_set);
182 183
183 if (drop_item_ && drop_position_ != MenuDelegate::DROP_ON) 184 if (drop_item_ && drop_position_ != MenuDelegate::DROP_ON)
184 PaintDropIndicator(canvas, drop_item_, drop_position_); 185 PaintDropIndicator(canvas, drop_item_, drop_position_);
185 } 186 }
186 187
187 bool SubmenuView::GetDropFormats( 188 bool SubmenuView::GetDropFormats(
188 int* formats, 189 int* formats,
189 std::set<OSExchangeData::CustomFormat>* custom_formats) { 190 std::set<OSExchangeData::CustomFormat>* custom_formats) {
190 DCHECK(GetMenuItem()->GetMenuController()); 191 DCHECK(GetMenuItem()->GetMenuController());
191 return GetMenuItem()->GetMenuController()->GetDropFormats(this, formats, 192 return GetMenuItem()->GetMenuController()->GetDropFormats(this, formats,
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 y = std::max(y, 0); 492 y = std::max(y, 0);
492 gfx::Rect new_vis_bounds(x, y, vis_bounds.width(), vis_bounds.height()); 493 gfx::Rect new_vis_bounds(x, y, vis_bounds.width(), vis_bounds.height());
493 if (new_vis_bounds != vis_bounds) { 494 if (new_vis_bounds != vis_bounds) {
494 ScrollRectToVisible(new_vis_bounds); 495 ScrollRectToVisible(new_vis_bounds);
495 return true; 496 return true;
496 } 497 }
497 return false; 498 return false;
498 } 499 }
499 500
500 } // namespace views 501 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/submenu_view.h ('k') | ui/views/controls/separator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698