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

Side by Side Diff: ui/views/cocoa/bridged_content_view.mm

Issue 1477253002: Use a single views::MenuConfig instance for each platform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add menu_config_android Created 5 years 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/BUILD.gn ('k') | ui/views/controls/combobox/combobox.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #import "ui/views/cocoa/bridged_content_view.h" 5 #import "ui/views/cocoa/bridged_content_view.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #import "base/mac/scoped_nsobject.h" 8 #import "base/mac/scoped_nsobject.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "skia/ext/skia_utils_mac.h" 10 #include "skia/ext/skia_utils_mac.h"
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 hostedView_->SetSize(gfx::Size(newSize.width, newSize.height)); 305 hostedView_->SetSize(gfx::Size(newSize.width, newSize.height));
306 } 306 }
307 307
308 - (void)drawRect:(NSRect)dirtyRect { 308 - (void)drawRect:(NSRect)dirtyRect {
309 // Note that BridgedNativeWidget uses -[NSWindow setAutodisplay:NO] to 309 // Note that BridgedNativeWidget uses -[NSWindow setAutodisplay:NO] to
310 // suppress calls to this when the window is known to be hidden. 310 // suppress calls to this when the window is known to be hidden.
311 if (!hostedView_) 311 if (!hostedView_)
312 return; 312 return;
313 313
314 if (drawMenuBackgroundForBlur_) { 314 if (drawMenuBackgroundForBlur_) {
315 const CGFloat radius = views::MenuConfig::instance(nullptr).corner_radius; 315 const CGFloat radius = views::MenuConfig::instance().corner_radius;
316 [skia::SkColorToSRGBNSColor(0x01000000) set]; 316 [skia::SkColorToSRGBNSColor(0x01000000) set];
317 [[NSBezierPath bezierPathWithRoundedRect:[self bounds] 317 [[NSBezierPath bezierPathWithRoundedRect:[self bounds]
318 xRadius:radius 318 xRadius:radius
319 yRadius:radius] fill]; 319 yRadius:radius] fill];
320 } 320 }
321 321
322 // If there's a layer, painting occurs in BridgedNativeWidget::OnPaintLayer(). 322 // If there's a layer, painting occurs in BridgedNativeWidget::OnPaintLayer().
323 if (hostedView_->GetWidget()->GetLayer()) 323 if (hostedView_->GetWidget()->GetLayer())
324 return; 324 return;
325 325
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 } 722 }
723 723
724 return [super accessibilityAttributeValue:attribute]; 724 return [super accessibilityAttributeValue:attribute];
725 } 725 }
726 726
727 - (id)accessibilityHitTest:(NSPoint)point { 727 - (id)accessibilityHitTest:(NSPoint)point {
728 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; 728 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point];
729 } 729 }
730 730
731 @end 731 @end
OLDNEW
« no previous file with comments | « ui/views/BUILD.gn ('k') | ui/views/controls/combobox/combobox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698