Lines should have <= 80 columns

This commit is contained in:
Cheng Zhao 2015-04-13 20:10:51 +08:00
parent c10b9ea511
commit 29338e2fa4
2 changed files with 20 additions and 22 deletions

View file

@ -4,10 +4,9 @@
#import "atom/browser/mac/atom_application.h" #import "atom/browser/mac/atom_application.h"
#include "atom/browser/browser.h"
#include "base/auto_reset.h" #include "base/auto_reset.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "atom/browser/browser.h"
#include "content/public/browser/browser_accessibility_state.h" #include "content/public/browser/browser_accessibility_state.h"
@implementation AtomApplication @implementation AtomApplication
@ -49,7 +48,7 @@
} }
- (void)accessibilitySetValue:(id)value forAttribute:(NSString *)attribute { - (void)accessibilitySetValue:(id)value forAttribute:(NSString *)attribute {
// undocumented attribute that VoiceOver happens to set while running. // Undocumented attribute that VoiceOver happens to set while running.
// Chromium uses this too, even though it's not exactly right. // Chromium uses this too, even though it's not exactly right.
if ([attribute isEqualToString:@"AXEnhancedUserInterface"]) { if ([attribute isEqualToString:@"AXEnhancedUserInterface"]) {
[self updateAccessibilityEnabled:[value boolValue]]; [self updateAccessibilityEnabled:[value boolValue]];
@ -58,7 +57,7 @@
} }
- (void)updateAccessibilityEnabled:(BOOL)enabled { - (void)updateAccessibilityEnabled:(BOOL)enabled {
content::BrowserAccessibilityState *ax_state = content::BrowserAccessibilityState::GetInstance(); auto ax_state = content::BrowserAccessibilityState::GetInstance();
if (enabled) { if (enabled) {
ax_state->OnScreenReaderDetected(); ax_state->OnScreenReaderDetected();

View file

@ -11,11 +11,11 @@
#include "atom/common/options_switches.h" #include "atom/common/options_switches.h"
#include "base/mac/mac_util.h" #include "base/mac/mac_util.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "content/public/browser/browser_accessibility_state.h"
#include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/native_web_keyboard_event.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "content/public/browser/render_view_host.h" #include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/browser_accessibility_state.h"
#include "native_mate/dictionary.h" #include "native_mate/dictionary.h"
#include "vendor/brightray/browser/inspectable_web_contents.h" #include "vendor/brightray/browser/inspectable_web_contents.h"
#include "vendor/brightray/browser/inspectable_web_contents_view.h" #include "vendor/brightray/browser/inspectable_web_contents_view.h"
@ -195,24 +195,23 @@ static const CGFloat kAtomWindowCornerRadius = 4.0;
} }
- (id)accessibilityAttributeValue:(NSString*)attribute { - (id)accessibilityAttributeValue:(NSString*)attribute {
if ([attribute isEqualToString:@"AXChildren"]) { if (![attribute isEqualToString:@"AXChildren"])
NSArray *children = [super accessibilityAttributeValue:attribute]; return [super accessibilityAttributeValue:attribute];
// Filter out objects that aren't the title bar buttons. // Filter out objects that aren't the title bar buttons. This has the effect
// This has the effect of removing the window title, which VoiceOver already sees. // of removing the window title, which VoiceOver already sees.
// * when VoiceOver is disabled, this causes Cmd+C to be used for TTS but still // * when VoiceOver is disabled, this causes Cmd+C to be used for TTS but
// leaves the buttons available in the accessibility tree. // still leaves the buttons available in the accessibility tree.
// * when VoiceOver is enabled, the full accessibility tree is used. // * when VoiceOver is enabled, the full accessibility tree is used.
// Without removing the title and with VO disabled, the TTS would always read the // Without removing the title and with VO disabled, the TTS would always read
// window title instead of using Cmd+C to get the selected text. // the window title instead of using Cmd+C to get the selected text.
NSPredicate *predicate = [NSPredicate predicateWithFormat: NSPredicate *predicate = [NSPredicate predicateWithFormat:
@"(self isKindOfClass: %@) OR (self.className == %@)", @"(self isKindOfClass: %@) OR (self.className == %@)",
[NSButtonCell class], @"RenderWidgetHostViewCocoa"]; [NSButtonCell class],
@"RenderWidgetHostViewCocoa"];
NSArray *children = [super accessibilityAttributeValue:attribute];
return [children filteredArrayUsingPredicate:predicate]; return [children filteredArrayUsingPredicate:predicate];
}
return [super accessibilityAttributeValue:attribute];
} }
@end @end