| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/chrome_browser_window.h" | 5 #import "chrome/browser/cocoa/chrome_browser_window.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/browser_theme_provider.h" | 8 #include "chrome/browser/browser_theme_provider.h" |
| 9 #import "chrome/browser/cocoa/browser_frame_view.h" | 9 #import "chrome/browser/cocoa/browser_frame_view.h" |
| 10 #import "chrome/browser/cocoa/browser_window_controller.h" | 10 #import "chrome/browser/cocoa/browser_window_controller.h" |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 if (newEntered != entered_) { | 236 if (newEntered != entered_) { |
| 237 // Buttons have moved, so update button state. | 237 // Buttons have moved, so update button state. |
| 238 entered_ = newEntered; | 238 entered_ = newEntered; |
| 239 [closeButton_ setNeedsDisplay]; | 239 [closeButton_ setNeedsDisplay]; |
| 240 [zoomButton_ setNeedsDisplay]; | 240 [zoomButton_ setNeedsDisplay]; |
| 241 [miniaturizeButton_ setNeedsDisplay]; | 241 [miniaturizeButton_ setNeedsDisplay]; |
| 242 } | 242 } |
| 243 } | 243 } |
| 244 } | 244 } |
| 245 | 245 |
| 246 - (void)underlaySurfaceAdded { |
| 247 DCHECK_GE(underlaySurfaceCount_, 0); |
| 248 ++underlaySurfaceCount_; |
| 249 |
| 250 // We're having the OpenGL surface render under the window, so the window |
| 251 // needs to be not opaque. |
| 252 if (underlaySurfaceCount_ == 1) |
| 253 [self setOpaque:NO]; |
| 254 } |
| 255 |
| 256 - (void)underlaySurfaceRemoved { |
| 257 --underlaySurfaceCount_; |
| 258 DCHECK_GE(underlaySurfaceCount_, 0); |
| 259 |
| 260 if (underlaySurfaceCount_ == 0) |
| 261 [self setOpaque:YES]; |
| 262 } |
| 263 |
| 246 - (void)windowMainStatusChanged { | 264 - (void)windowMainStatusChanged { |
| 247 [closeButton_ setNeedsDisplay]; | 265 [closeButton_ setNeedsDisplay]; |
| 248 [zoomButton_ setNeedsDisplay]; | 266 [zoomButton_ setNeedsDisplay]; |
| 249 [miniaturizeButton_ setNeedsDisplay]; | 267 [miniaturizeButton_ setNeedsDisplay]; |
| 250 NSView* frameView = [self frameView]; | 268 NSView* frameView = [self frameView]; |
| 251 NSView* contentView = [self contentView]; | 269 NSView* contentView = [self contentView]; |
| 252 NSRect updateRect = [frameView frame]; | 270 NSRect updateRect = [frameView frame]; |
| 253 NSRect contentRect = [contentView frame]; | 271 NSRect contentRect = [contentView frame]; |
| 254 CGFloat tabStripHeight = [TabStripController defaultTabHeight]; | 272 CGFloat tabStripHeight = [TabStripController defaultTabHeight]; |
| 255 updateRect.size.height -= NSHeight(contentRect) - tabStripHeight; | 273 updateRect.size.height -= NSHeight(contentRect) - tabStripHeight; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 } | 380 } |
| 363 | 381 |
| 364 - (NSPoint)themePatternPhase { | 382 - (NSPoint)themePatternPhase { |
| 365 id delegate = [self delegate]; | 383 id delegate = [self delegate]; |
| 366 if (![delegate respondsToSelector:@selector(themePatternPhase)]) | 384 if (![delegate respondsToSelector:@selector(themePatternPhase)]) |
| 367 return NSMakePoint(0, 0); | 385 return NSMakePoint(0, 0); |
| 368 return [delegate themePatternPhase]; | 386 return [delegate themePatternPhase]; |
| 369 } | 387 } |
| 370 | 388 |
| 371 @end | 389 @end |
| OLD | NEW |