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

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

Issue 267593005: Refactor menu controller to isolate aura dependency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removing ifdefs, work in progress 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 | Annotate | Revision Log
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/menu_scroll_view_container.h" 5 #include "ui/views/controls/menu/menu_scroll_view_container.h"
6 6
7 #include "third_party/skia/include/core/SkPaint.h" 7 #include "third_party/skia/include/core/SkPaint.h"
8 #include "third_party/skia/include/core/SkPath.h" 8 #include "third_party/skia/include/core/SkPath.h"
9 #include "ui/accessibility/ax_view_state.h" 9 #include "ui/accessibility/ax_view_state.h"
10 #include "ui/gfx/canvas.h" 10 #include "ui/gfx/canvas.h"
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 arrow_ = BubbleBorder::NONE; 274 arrow_ = BubbleBorder::NONE;
275 bubble_border_ = NULL; 275 bubble_border_ = NULL;
276 276
277 const MenuConfig& menu_config = 277 const MenuConfig& menu_config =
278 content_view_->GetMenuItem()->GetMenuConfig(); 278 content_view_->GetMenuItem()->GetMenuConfig();
279 279
280 bool use_border = true; 280 bool use_border = true;
281 int padding = menu_config.corner_radius > 0 ? 281 int padding = menu_config.corner_radius > 0 ?
282 kBorderPaddingDueToRoundedCorners : 0; 282 kBorderPaddingDueToRoundedCorners : 0;
283 283
284 #if !(defined(OS_LINUX) && !defined(OS_CHROMEOS)) 284 #if defined(USE_AURA) && !(defined(OS_LINUX) && !defined(OS_CHROMEOS))
285 if (menu_config.native_theme == ui::NativeThemeAura::instance()) { 285 if (menu_config.native_theme == ui::NativeThemeAura::instance()) {
286 // In case of NativeThemeAura the border gets drawn with the shadow. 286 // In case of NativeThemeAura the border gets drawn with the shadow.
287 // Furthermore no additional padding is wanted. 287 // Furthermore no additional padding is wanted.
288 use_border = false; 288 use_border = false;
289 padding = 0; 289 padding = 0;
290 } 290 }
291 #endif 291 #endif
292 292
293 int top = menu_config.menu_vertical_border_size + padding; 293 int top = menu_config.menu_vertical_border_size + padding;
294 int left = menu_config.menu_horizontal_border_size + padding; 294 int left = menu_config.menu_horizontal_border_size + padding;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 case views::MenuItemView::BUBBLE_ABOVE: 326 case views::MenuItemView::BUBBLE_ABOVE:
327 return BubbleBorder::BOTTOM_CENTER; 327 return BubbleBorder::BOTTOM_CENTER;
328 case views::MenuItemView::BUBBLE_BELOW: 328 case views::MenuItemView::BUBBLE_BELOW:
329 return BubbleBorder::TOP_CENTER; 329 return BubbleBorder::TOP_CENTER;
330 default: 330 default:
331 return BubbleBorder::NONE; 331 return BubbleBorder::NONE;
332 } 332 }
333 } 333 }
334 334
335 } // namespace views 335 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698