| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/cocoa/browser_window_controller.h" | 5 #import "chrome/browser/cocoa/browser_window_controller.h" |
| 6 | 6 |
| 7 #include <Carbon/Carbon.h> | 7 #include <Carbon/Carbon.h> |
| 8 | 8 |
| 9 #include "app/l10n_util_mac.h" | 9 #include "app/l10n_util_mac.h" |
| 10 #include "base/mac_util.h" | 10 #include "base/mac_util.h" |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 - (void)windowDidBecomeMain:(NSNotification*)notification { | 427 - (void)windowDidBecomeMain:(NSNotification*)notification { |
| 428 BrowserList::SetLastActive(browser_.get()); | 428 BrowserList::SetLastActive(browser_.get()); |
| 429 [self saveWindowPositionIfNeeded]; | 429 [self saveWindowPositionIfNeeded]; |
| 430 | 430 |
| 431 // TODO(dmaclach): Instead of redrawing the whole window, views that care | 431 // TODO(dmaclach): Instead of redrawing the whole window, views that care |
| 432 // about the active window state should be registering for notifications. | 432 // about the active window state should be registering for notifications. |
| 433 [[self window] setViewsNeedDisplay:YES]; | 433 [[self window] setViewsNeedDisplay:YES]; |
| 434 | 434 |
| 435 // TODO(viettrungluu): For some reason, the above doesn't suffice. | 435 // TODO(viettrungluu): For some reason, the above doesn't suffice. |
| 436 if ([self isFullscreen]) | 436 if ([self isFullscreen]) |
| 437 [floatingBarBackingView_ setNeedsDisplay:YES]; | 437 [floatingBarBackingView_ setNeedsDisplay:YES]; // Okay even if nil. |
| 438 } | 438 } |
| 439 | 439 |
| 440 - (void)windowDidResignMain:(NSNotification*)notification { | 440 - (void)windowDidResignMain:(NSNotification*)notification { |
| 441 // TODO(dmaclach): Instead of redrawing the whole window, views that care | 441 // TODO(dmaclach): Instead of redrawing the whole window, views that care |
| 442 // about the active window state should be registering for notifications. | 442 // about the active window state should be registering for notifications. |
| 443 [[self window] setViewsNeedDisplay:YES]; | 443 [[self window] setViewsNeedDisplay:YES]; |
| 444 | 444 |
| 445 // TODO(viettrungluu): For some reason, the above doesn't suffice. | 445 // TODO(viettrungluu): For some reason, the above doesn't suffice. |
| 446 if ([self isFullscreen]) | 446 if ([self isFullscreen]) |
| 447 [floatingBarBackingView_ setNeedsDisplay:YES]; | 447 [floatingBarBackingView_ setNeedsDisplay:YES]; // Okay even if nil. |
| 448 } | 448 } |
| 449 | 449 |
| 450 // Called when we are activated (when we gain focus). | 450 // Called when we are activated (when we gain focus). |
| 451 - (void)windowDidBecomeKey:(NSNotification*)notification { | 451 - (void)windowDidBecomeKey:(NSNotification*)notification { |
| 452 // We need to activate the controls (in the "WebView"). To do this, get the | 452 // We need to activate the controls (in the "WebView"). To do this, get the |
| 453 // selected TabContents's RenderWidgetHostViewMac and tell it to activate. | 453 // selected TabContents's RenderWidgetHostViewMac and tell it to activate. |
| 454 if (TabContents* contents = browser_->GetSelectedTabContents()) { | 454 if (TabContents* contents = browser_->GetSelectedTabContents()) { |
| 455 if (RenderWidgetHostView* rwhv = contents->GetRenderWidgetHostView()) | 455 if (RenderWidgetHostView* rwhv = contents->GetRenderWidgetHostView()) |
| 456 rwhv->SetActive(true); | 456 rwhv->SetActive(true); |
| 457 } | 457 } |
| (...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1796 | 1796 |
| 1797 - (BOOL)supportsBookmarkBar { | 1797 - (BOOL)supportsBookmarkBar { |
| 1798 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 1798 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
| 1799 } | 1799 } |
| 1800 | 1800 |
| 1801 - (BOOL)isNormalWindow { | 1801 - (BOOL)isNormalWindow { |
| 1802 return browser_->type() == Browser::TYPE_NORMAL; | 1802 return browser_->type() == Browser::TYPE_NORMAL; |
| 1803 } | 1803 } |
| 1804 | 1804 |
| 1805 @end // @implementation BrowserWindowController(WindowType) | 1805 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |