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 #import <Carbon/Carbon.h> | 5 #import <Carbon/Carbon.h> |
6 | 6 |
7 #import "content/browser/web_contents/web_contents_view_mac.h" | 7 #import "content/browser/web_contents/web_contents_view_mac.h" |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
220 return rwhv ? rwhv->GetNativeView() : nil; | 220 return rwhv ? rwhv->GetNativeView() : nil; |
221 } | 221 } |
222 | 222 |
223 void WebContentsViewMac::Focus() { | 223 void WebContentsViewMac::Focus() { |
224 gfx::NativeView native_view = GetNativeViewForFocus(); | 224 gfx::NativeView native_view = GetNativeViewForFocus(); |
225 NSWindow* window = [native_view window]; | 225 NSWindow* window = [native_view window]; |
226 [window makeFirstResponder:native_view]; | 226 [window makeFirstResponder:native_view]; |
227 if (![window isVisible]) | 227 if (![window isVisible]) |
228 return; | 228 return; |
229 [window makeKeyAndOrderFront:nil]; | 229 [window makeKeyAndOrderFront:nil]; |
230 [NSApp activateIgnoringOtherApps:YES]; | |
Avi (use Gerrit)
2017/03/02 23:26:18
I could swear I've seen this change before.
Who e
Sidney San Martín
2017/03/08 05:02:29
One of these?
https://codereview.chromium.org/2412
Sidney San Martín
2017/03/08 05:02:29
I'd missed some callers… so, thanks! I found a mor
| |
230 } | 231 } |
231 | 232 |
232 void WebContentsViewMac::SetInitialFocus() { | 233 void WebContentsViewMac::SetInitialFocus() { |
233 if (web_contents_->FocusLocationBarByDefault()) | 234 if (web_contents_->FocusLocationBarByDefault()) |
234 web_contents_->SetFocusToLocationBar(false); | 235 web_contents_->SetFocusToLocationBar(false); |
235 else | 236 else |
236 Focus(); | 237 Focus(); |
237 } | 238 } |
238 | 239 |
239 void WebContentsViewMac::StoreFocus() { | 240 void WebContentsViewMac::StoreFocus() { |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
734 | 735 |
735 - (void)viewDidHide { | 736 - (void)viewDidHide { |
736 [self updateWebContentsVisibility]; | 737 [self updateWebContentsVisibility]; |
737 } | 738 } |
738 | 739 |
739 - (void)viewDidUnhide { | 740 - (void)viewDidUnhide { |
740 [self updateWebContentsVisibility]; | 741 [self updateWebContentsVisibility]; |
741 } | 742 } |
742 | 743 |
743 @end | 744 @end |
OLD | NEW |