| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/app_toolbar_button.h" | 5 #import "chrome/browser/ui/cocoa/toolbar/app_toolbar_button.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #import "chrome/browser/ui/cocoa/themed_window.h" | 8 #import "chrome/browser/ui/cocoa/themed_window.h" |
| 9 #import "chrome/browser/ui/cocoa/view_id_util.h" | 9 #import "chrome/browser/ui/cocoa/view_id_util.h" |
| 10 #include "ui/base/material_design/material_design_controller.h" | 10 #include "ui/base/material_design/material_design_controller.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 - (gfx::VectorIconId)vectorIconId { | 54 - (gfx::VectorIconId)vectorIconId { |
| 55 CHECK(ui::MaterialDesignController::IsModeMaterial()); | 55 CHECK(ui::MaterialDesignController::IsModeMaterial()); |
| 56 switch (type_) { | 56 switch (type_) { |
| 57 case AppMenuIconController::IconType::NONE: | 57 case AppMenuIconController::IconType::NONE: |
| 58 DCHECK_EQ(severity_, AppMenuIconPainter::SEVERITY_NONE); | 58 DCHECK_EQ(severity_, AppMenuIconPainter::SEVERITY_NONE); |
| 59 return gfx::VectorIconId::BROWSER_TOOLS; | 59 return gfx::VectorIconId::BROWSER_TOOLS; |
| 60 case AppMenuIconController::IconType::UPGRADE_NOTIFICATION: | 60 case AppMenuIconController::IconType::UPGRADE_NOTIFICATION: |
| 61 return gfx::VectorIconId::BROWSER_TOOLS_UPDATE; | 61 return gfx::VectorIconId::BROWSER_TOOLS_UPDATE; |
| 62 case AppMenuIconController::IconType::GLOBAL_ERROR: | 62 case AppMenuIconController::IconType::GLOBAL_ERROR: |
| 63 case AppMenuIconController::IconType::INCOMPATIBILITY_WARNING: |
| 63 return gfx::VectorIconId::BROWSER_TOOLS_ERROR; | 64 return gfx::VectorIconId::BROWSER_TOOLS_ERROR; |
| 64 case AppMenuIconController::IconType::INCOMPATIBILITY_WARNING: | |
| 65 return gfx::VectorIconId::BROWSER_TOOLS_WARNING; | |
| 66 } | 65 } |
| 67 | 66 |
| 68 return gfx::VectorIconId::VECTOR_ICON_NONE; | 67 return gfx::VectorIconId::VECTOR_ICON_NONE; |
| 69 } | 68 } |
| 70 | 69 |
| 71 - (SkColor)vectorIconColor:(BOOL)themeIsDark { | 70 - (SkColor)vectorIconColor:(BOOL)themeIsDark { |
| 72 switch (severity_) { | 71 switch (severity_) { |
| 73 case AppMenuIconPainter::Severity::SEVERITY_NONE: | 72 case AppMenuIconPainter::Severity::SEVERITY_NONE: |
| 74 return themeIsDark ? SK_ColorWHITE : gfx::kChromeIconGrey; | 73 return themeIsDark ? SK_ColorWHITE : gfx::kChromeIconGrey; |
| 75 break; | 74 break; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 96 shouldAnimate:(BOOL)shouldAnimate { | 95 shouldAnimate:(BOOL)shouldAnimate { |
| 97 if (severity != severity_ || type != type_) { | 96 if (severity != severity_ || type != type_) { |
| 98 severity_ = severity; | 97 severity_ = severity; |
| 99 type_ = type; | 98 type_ = type; |
| 100 // Update the button state images with the new severity color or icon type. | 99 // Update the button state images with the new severity color or icon type. |
| 101 [self resetButtonStateImages]; | 100 [self resetButtonStateImages]; |
| 102 } | 101 } |
| 103 } | 102 } |
| 104 | 103 |
| 105 @end | 104 @end |
| OLD | NEW |