OLD | NEW |
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 "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h" | 5 #include "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h" |
6 | 6 |
7 #include <Carbon/Carbon.h> // kVK_Return | 7 #include <Carbon/Carbon.h> // kVK_Return |
8 | 8 |
9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 // Opening a URL in a background tab should also revert the omnibox contents | 872 // Opening a URL in a background tab should also revert the omnibox contents |
873 // to their original state. We cannot do a blanket revert in OpenURL() | 873 // to their original state. We cannot do a blanket revert in OpenURL() |
874 // because middle-clicks also open in a new background tab, but those should | 874 // because middle-clicks also open in a new background tab, but those should |
875 // not revert the omnibox text. | 875 // not revert the omnibox text. |
876 RevertAll(); | 876 RevertAll(); |
877 return true; | 877 return true; |
878 } | 878 } |
879 | 879 |
880 // Option-Return | 880 // Option-Return |
881 if (cmd == @selector(insertNewlineIgnoringFieldEditor:)) { | 881 if (cmd == @selector(insertNewlineIgnoringFieldEditor:)) { |
882 model()->AcceptInput(NEW_FOREGROUND_TAB, false); | 882 model()->AcceptInput(WindowOpenDisposition::NEW_FOREGROUND_TAB, false); |
883 return true; | 883 return true; |
884 } | 884 } |
885 | 885 |
886 // When the user does Control-Enter, the existing content has "www." | 886 // When the user does Control-Enter, the existing content has "www." |
887 // prepended and ".com" appended. model() should already have | 887 // prepended and ".com" appended. model() should already have |
888 // received notification when the Control key was depressed, but it | 888 // received notification when the Control key was depressed, but it |
889 // is safe to tell it twice. | 889 // is safe to tell it twice. |
890 if (cmd == @selector(insertLineBreak:)) { | 890 if (cmd == @selector(insertLineBreak:)) { |
891 OnControlKeyChanged(true); | 891 OnControlKeyChanged(true); |
892 WindowOpenDisposition disposition = | 892 WindowOpenDisposition disposition = |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 display_text); | 1139 display_text); |
1140 NSDictionary* notification_info = @{ | 1140 NSDictionary* notification_info = @{ |
1141 NSAccessibilityAnnouncementKey : announcement, | 1141 NSAccessibilityAnnouncementKey : announcement, |
1142 NSAccessibilityPriorityKey : @(NSAccessibilityPriorityHigh) | 1142 NSAccessibilityPriorityKey : @(NSAccessibilityPriorityHigh) |
1143 }; | 1143 }; |
1144 NSAccessibilityPostNotificationWithUserInfo( | 1144 NSAccessibilityPostNotificationWithUserInfo( |
1145 [field_ window], | 1145 [field_ window], |
1146 NSAccessibilityAnnouncementRequestedNotification, | 1146 NSAccessibilityAnnouncementRequestedNotification, |
1147 notification_info); | 1147 notification_info); |
1148 } | 1148 } |
OLD | NEW |