]> khamidou — GitHub mirrors - electron.git/commitdiff
Lines should have <= 80 columns
authorCheng Zhao <zcbenz@gmail.com>
Mon, 13 Apr 2015 12:10:51 +0000 (20:10 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 13 Apr 2015 12:10:51 +0000 (20:10 +0800)
atom/browser/mac/atom_application.mm
atom/browser/native_window_mac.mm

index 7d1fd532012ad7e6ab9c012704bb315f084a189f..b8377181359ceccc42d714feb4f411a0a4912336 100644 (file)
@@ -4,10 +4,9 @@
 
 #import "atom/browser/mac/atom_application.h"
 
+#include "atom/browser/browser.h"
 #include "base/auto_reset.h"
 #include "base/strings/sys_string_conversions.h"
-#include "atom/browser/browser.h"
-
 #include "content/public/browser/browser_accessibility_state.h"
 
 @implementation AtomApplication
@@ -49,7 +48,7 @@
 }
 
 - (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.
   if ([attribute isEqualToString:@"AXEnhancedUserInterface"]) {
     [self updateAccessibilityEnabled:[value boolValue]];
@@ -58,7 +57,7 @@
 }
 
 - (void)updateAccessibilityEnabled:(BOOL)enabled {
-  content::BrowserAccessibilityState *ax_state = content::BrowserAccessibilityState::GetInstance();
+  auto ax_state = content::BrowserAccessibilityState::GetInstance();
 
   if (enabled) {
     ax_state->OnScreenReaderDetected();
index 05edf173b308d6181765fdc8ca1e2e9937050575..668826624b4b5f36bd2510f32f995e840d142989 100644 (file)
 #include "atom/common/options_switches.h"
 #include "base/mac/mac_util.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/web_contents.h"
 #include "content/public/browser/render_view_host.h"
 #include "content/public/browser/render_widget_host_view.h"
-#include "content/public/browser/browser_accessibility_state.h"
 #include "native_mate/dictionary.h"
 #include "vendor/brightray/browser/inspectable_web_contents.h"
 #include "vendor/brightray/browser/inspectable_web_contents_view.h"
@@ -195,24 +195,23 @@ static const CGFloat kAtomWindowCornerRadius = 4.0;
 }
 
 - (id)accessibilityAttributeValue:(NSString*)attribute {
-  if ([attribute isEqualToString:@"AXChildren"]) {
-    NSArray *children = [super accessibilityAttributeValue:attribute];
-
-    // Filter out objects that aren't the title bar buttons.
-    // This has the effect of removing the window title, which VoiceOver already sees.
-    //  * when VoiceOver is disabled, this causes Cmd+C to be used for TTS but still
-    //    leaves the buttons available in the accessibility tree.
-    //  * when VoiceOver is enabled, the full accessibility tree is used.
-    // Without removing the title and with VO disabled, the TTS would always read the
-    // window title instead of using Cmd+C to get the selected text.
-    NSPredicate *predicate = [NSPredicate predicateWithFormat:
-                                @"(self isKindOfClass: %@) OR (self.className == %@)",
-                                [NSButtonCell class], @"RenderWidgetHostViewCocoa"];
-    
-    return [children filteredArrayUsingPredicate:predicate];
-  }
-  
-  return [super accessibilityAttributeValue:attribute];
+  if (![attribute isEqualToString:@"AXChildren"])
+    return [super accessibilityAttributeValue:attribute];
+
+  // Filter out objects that aren't the title bar buttons. This has the effect
+  // of removing the window title, which VoiceOver already sees.
+  // * when VoiceOver is disabled, this causes Cmd+C to be used for TTS but
+  //   still leaves the buttons available in the accessibility tree.
+  // * when VoiceOver is enabled, the full accessibility tree is used.
+  // Without removing the title and with VO disabled, the TTS would always read
+  // the window title instead of using Cmd+C to get the selected text.
+  NSPredicate *predicate = [NSPredicate predicateWithFormat:
+      @"(self isKindOfClass: %@) OR (self.className == %@)",
+      [NSButtonCell class],
+      @"RenderWidgetHostViewCocoa"];
+
+  NSArray *children = [super accessibilityAttributeValue:attribute];
+  return [children filteredArrayUsingPredicate:predicate];
 }
 
 @end