| 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/toolbar/toolbar_controller.h" | 5 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/mac/bundle_locations.h" | 9 #include "base/mac/bundle_locations.h" |
| 10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 } | 554 } |
| 555 | 555 |
| 556 - (WrenchMenuController*)wrenchMenuController { | 556 - (WrenchMenuController*)wrenchMenuController { |
| 557 return wrenchMenuController_; | 557 return wrenchMenuController_; |
| 558 } | 558 } |
| 559 | 559 |
| 560 - (void)updateWrenchButtonSeverity { | 560 - (void)updateWrenchButtonSeverity { |
| 561 WrenchToolbarButtonCell* cell = | 561 WrenchToolbarButtonCell* cell = |
| 562 base::mac::ObjCCastStrict<WrenchToolbarButtonCell>([wrenchButton_ cell]); | 562 base::mac::ObjCCastStrict<WrenchToolbarButtonCell>([wrenchButton_ cell]); |
| 563 if (UpgradeDetector::GetInstance()->notify_upgrade()) { | 563 if (UpgradeDetector::GetInstance()->notify_upgrade()) { |
| 564 [cell setSeverity:WrenchIconPainter::SeverityFromUpgradeLevel( | 564 UpgradeDetector::UpgradeNotificationAnnoyanceLevel level = |
| 565 UpgradeDetector::GetInstance()->upgrade_notification_stage())]; | 565 UpgradeDetector::GetInstance()->upgrade_notification_stage(); |
| 566 [cell setSeverity:WrenchIconPainter::SeverityFromUpgradeLevel(level) |
| 567 shouldAnimate:WrenchIconPainter::ShouldAnimateUpgradeLevel(level)]; |
| 566 return; | 568 return; |
| 567 } | 569 } |
| 568 | 570 |
| 569 GlobalError* error = GlobalErrorServiceFactory::GetForProfile( | 571 GlobalError* error = GlobalErrorServiceFactory::GetForProfile( |
| 570 browser_->profile())->GetHighestSeverityGlobalErrorWithWrenchMenuItem(); | 572 browser_->profile())->GetHighestSeverityGlobalErrorWithWrenchMenuItem(); |
| 571 if (error) { | 573 if (error) { |
| 572 [cell setSeverity:WrenchIconPainter::SeverityFromGlobalErrorSeverity( | 574 [cell setSeverity:WrenchIconPainter::SeverityFromGlobalErrorSeverity( |
| 573 error->GetSeverity())]; | 575 error->GetSeverity()) |
| 576 shouldAnimate:YES]; |
| 574 return; | 577 return; |
| 575 } | 578 } |
| 576 | 579 |
| 577 [cell setSeverity:WrenchIconPainter::SEVERITY_NONE]; | 580 [cell setSeverity:WrenchIconPainter::SEVERITY_NONE shouldAnimate:YES]; |
| 578 } | 581 } |
| 579 | 582 |
| 580 - (void)prefChanged:(const std::string&)prefName { | 583 - (void)prefChanged:(const std::string&)prefName { |
| 581 if (prefName == prefs::kShowHomeButton) { | 584 if (prefName == prefs::kShowHomeButton) { |
| 582 [self showOptionalHomeButton]; | 585 [self showOptionalHomeButton]; |
| 583 } | 586 } |
| 584 } | 587 } |
| 585 | 588 |
| 586 - (void)createBrowserActionButtons { | 589 - (void)createBrowserActionButtons { |
| 587 if (!browserActionsController_.get()) { | 590 if (!browserActionsController_.get()) { |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 - (void)hideDropURLsIndicatorInView:(NSView*)view { | 811 - (void)hideDropURLsIndicatorInView:(NSView*)view { |
| 809 // Do nothing. | 812 // Do nothing. |
| 810 } | 813 } |
| 811 | 814 |
| 812 // (URLDropTargetController protocol) | 815 // (URLDropTargetController protocol) |
| 813 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { | 816 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { |
| 814 return drag_util::IsUnsupportedDropData(profile_, info); | 817 return drag_util::IsUnsupportedDropData(profile_, info); |
| 815 } | 818 } |
| 816 | 819 |
| 817 @end | 820 @end |
| OLD | NEW |