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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 #endif | 276 #endif |
277 } | 277 } |
278 } | 278 } |
279 | 279 |
280 void OmniboxViewMac::ResetTabState(WebContents* web_contents) { | 280 void OmniboxViewMac::ResetTabState(WebContents* web_contents) { |
281 StoreStateToTab(web_contents, nullptr); | 281 StoreStateToTab(web_contents, nullptr); |
282 } | 282 } |
283 | 283 |
284 void OmniboxViewMac::Update() { | 284 void OmniboxViewMac::Update() { |
285 if (model()->UpdatePermanentText()) { | 285 if (model()->UpdatePermanentText()) { |
286 // Something visibly changed. Re-enable URL replacement. | |
287 controller()->GetToolbarModel()->set_url_replacement_enabled(true); | |
288 model()->UpdatePermanentText(); | |
289 | |
290 const bool was_select_all = IsSelectAll(); | 286 const bool was_select_all = IsSelectAll(); |
291 NSTextView* text_view = | 287 NSTextView* text_view = |
292 base::mac::ObjCCastStrict<NSTextView>([field_ currentEditor]); | 288 base::mac::ObjCCastStrict<NSTextView>([field_ currentEditor]); |
293 const bool was_reversed = | 289 const bool was_reversed = |
294 [text_view selectionAffinity] == NSSelectionAffinityUpstream; | 290 [text_view selectionAffinity] == NSSelectionAffinityUpstream; |
295 | 291 |
296 // Restore everything to the baseline look. | 292 // Restore everything to the baseline look. |
297 RevertAll(); | 293 RevertAll(); |
298 | 294 |
299 // Only select all when we have focus. If we don't have focus, selecting | 295 // Only select all when we have focus. If we don't have focus, selecting |
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 display_text); | 1135 display_text); |
1140 NSDictionary* notification_info = @{ | 1136 NSDictionary* notification_info = @{ |
1141 NSAccessibilityAnnouncementKey : announcement, | 1137 NSAccessibilityAnnouncementKey : announcement, |
1142 NSAccessibilityPriorityKey : @(NSAccessibilityPriorityHigh) | 1138 NSAccessibilityPriorityKey : @(NSAccessibilityPriorityHigh) |
1143 }; | 1139 }; |
1144 NSAccessibilityPostNotificationWithUserInfo( | 1140 NSAccessibilityPostNotificationWithUserInfo( |
1145 [field_ window], | 1141 [field_ window], |
1146 NSAccessibilityAnnouncementRequestedNotification, | 1142 NSAccessibilityAnnouncementRequestedNotification, |
1147 notification_info); | 1143 notification_info); |
1148 } | 1144 } |
OLD | NEW |