Mac: Remove duplicate focus change notification

This commit is contained in:
Marshall Greenblatt 2016-07-11 17:11:42 -04:00
parent 558e60afba
commit 6779696971
2 changed files with 3 additions and 15 deletions

View File

@ -92,18 +92,6 @@
[super dealloc]; [super dealloc];
} }
// Called when we are activated (when we gain focus).
- (void)windowDidBecomeKey:(NSNotification*)notification {
if (browser_)
browser_->SetFocus(true);
}
// Called when we are deactivated (when we lose focus).
- (void)windowDidResignKey:(NSNotification*)notification {
if (browser_)
browser_->SetFocus(false);
}
- (BOOL)windowShouldClose:(id)window { - (BOOL)windowShouldClose:(id)window {
if (browser_ && !browser_->TryCloseBrowser()) { if (browser_ && !browser_->TryCloseBrowser()) {
// Cancel the close. // Cancel the close.

View File

@ -60,10 +60,12 @@ void BrowserWindowStdMac::ShowPopup(ClientWindowHandle parent_handle,
void BrowserWindowStdMac::Show() { void BrowserWindowStdMac::Show() {
REQUIRE_MAIN_THREAD(); REQUIRE_MAIN_THREAD();
// Nothing to do here. Chromium internally handles window show/hide.
} }
void BrowserWindowStdMac::Hide() { void BrowserWindowStdMac::Hide() {
REQUIRE_MAIN_THREAD(); REQUIRE_MAIN_THREAD();
// Nothing to do here. Chromium internally handles window show/hide.
} }
void BrowserWindowStdMac::SetBounds(int x, int y, size_t width, size_t height) { void BrowserWindowStdMac::SetBounds(int x, int y, size_t width, size_t height) {
@ -73,9 +75,7 @@ void BrowserWindowStdMac::SetBounds(int x, int y, size_t width, size_t height) {
void BrowserWindowStdMac::SetFocus(bool focus) { void BrowserWindowStdMac::SetFocus(bool focus) {
REQUIRE_MAIN_THREAD(); REQUIRE_MAIN_THREAD();
// Nothing to do here. Chromium internally handles window focus assignment.
if (browser_)
browser_->GetHost()->SetFocus(focus);
} }
ClientWindowHandle BrowserWindowStdMac::GetWindowHandle() const { ClientWindowHandle BrowserWindowStdMac::GetWindowHandle() const {