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 "chrome/browser/ui/cocoa/extensions/browser_action_button.h" | 5 #import "chrome/browser/ui/cocoa/extensions/browser_action_button.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 [self setImage:image.ToNSImage()]; | 377 [self setImage:image.ToNSImage()]; |
378 | 378 |
379 [self setEnabled:viewController_->IsEnabled(webContents)]; | 379 [self setEnabled:viewController_->IsEnabled(webContents)]; |
380 | 380 |
381 [self setNeedsDisplay:YES]; | 381 [self setNeedsDisplay:YES]; |
382 } | 382 } |
383 | 383 |
384 - (void)onRemoved { | 384 - (void)onRemoved { |
385 // The button is being removed from the toolbar, and the backing controller | 385 // The button is being removed from the toolbar, and the backing controller |
386 // will also be removed. Destroy the delegate. | 386 // will also be removed. Destroy the delegate. |
387 // We only need to do this because in cocoa's memory management, removing the | 387 // We only need to do this because in Cocoa's memory management, removing the |
388 // button from the toolbar doesn't synchronously dealloc it. | 388 // button from the toolbar doesn't synchronously dealloc it. |
389 viewControllerDelegate_.reset(); | 389 viewControllerDelegate_.reset(); |
390 } | 390 } |
391 | 391 |
392 - (BOOL)isAnimating { | 392 - (BOOL)isAnimating { |
393 return [moveAnimation_ isAnimating]; | 393 return [moveAnimation_ isAnimating]; |
394 } | 394 } |
395 | 395 |
396 - (NSRect)frameAfterAnimation { | 396 - (NSRect)frameAfterAnimation { |
397 if ([moveAnimation_ isAnimating]) { | 397 if ([moveAnimation_ isAnimating]) { |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 - (ui::ThemeProvider*)themeProviderForWindow:(NSWindow*)window { | 498 - (ui::ThemeProvider*)themeProviderForWindow:(NSWindow*)window { |
499 ui::ThemeProvider* themeProvider = [window themeProvider]; | 499 ui::ThemeProvider* themeProvider = [window themeProvider]; |
500 if (!themeProvider) | 500 if (!themeProvider) |
501 themeProvider = | 501 themeProvider = |
502 [[browserActionsController_ browser]->window()->GetNativeWindow() | 502 [[browserActionsController_ browser]->window()->GetNativeWindow() |
503 themeProvider]; | 503 themeProvider]; |
504 return themeProvider; | 504 return themeProvider; |
505 } | 505 } |
506 | 506 |
507 @end | 507 @end |
OLD | NEW |