| 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/reload_button_cocoa.h" | 5 #import "chrome/browser/ui/cocoa/toolbar/reload_button_cocoa.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| 11 #include "chrome/app/vector_icons/vector_icons.h" | |
| 12 #include "chrome/browser/command_updater.h" | 11 #include "chrome/browser/command_updater.h" |
| 13 #import "chrome/browser/ui/cocoa/accelerators_cocoa.h" | 12 #import "chrome/browser/ui/cocoa/accelerators_cocoa.h" |
| 14 #import "chrome/browser/ui/cocoa/themed_window.h" | 13 #import "chrome/browser/ui/cocoa/themed_window.h" |
| 15 #import "chrome/browser/ui/cocoa/view_id_util.h" | 14 #import "chrome/browser/ui/cocoa/view_id_util.h" |
| 16 #include "chrome/grit/generated_resources.h" | 15 #include "chrome/grit/generated_resources.h" |
| 17 #include "chrome/grit/theme_resources.h" | 16 #include "chrome/grit/theme_resources.h" |
| 18 #include "ui/base/accelerators/platform_accelerator_cocoa.h" | 17 #include "ui/base/accelerators/platform_accelerator_cocoa.h" |
| 19 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
| 20 #include "ui/base/l10n/l10n_util_mac.h" | 19 #include "ui/base/l10n/l10n_util_mac.h" |
| 21 #include "ui/base/material_design/material_design_controller.h" | 20 #include "ui/base/material_design/material_design_controller.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 } | 186 } |
| 188 } | 187 } |
| 189 | 188 |
| 190 return [super sendAction:theAction to:theTarget]; | 189 return [super sendAction:theAction to:theTarget]; |
| 191 } | 190 } |
| 192 | 191 |
| 193 - (ViewID)viewID { | 192 - (ViewID)viewID { |
| 194 return VIEW_ID_RELOAD_BUTTON; | 193 return VIEW_ID_RELOAD_BUTTON; |
| 195 } | 194 } |
| 196 | 195 |
| 197 - (const gfx::VectorIcon*)vectorIcon { | 196 - (gfx::VectorIconId)vectorIconId { |
| 198 if ([self tag] == IDC_RELOAD) { | 197 if ([self tag] == IDC_RELOAD) { |
| 199 return &kNavigateReloadIcon; | 198 return gfx::VectorIconId::NAVIGATE_RELOAD; |
| 200 } else if ([self tag] == IDC_STOP) { | 199 } else if ([self tag] == IDC_STOP) { |
| 201 return &kNavigateStopIcon; | 200 return gfx::VectorIconId::NAVIGATE_STOP; |
| 202 } else { | 201 } else { |
| 203 NOTREACHED(); | 202 NOTREACHED(); |
| 204 } | 203 } |
| 205 | 204 |
| 206 return nullptr; | 205 return gfx::VectorIconId::VECTOR_ICON_NONE; |
| 207 } | 206 } |
| 208 | 207 |
| 209 - (void)mouseInsideStateDidChange:(BOOL)isInside { | 208 - (void)mouseInsideStateDidChange:(BOOL)isInside { |
| 210 [pendingReloadTimer_ fire]; | 209 [pendingReloadTimer_ fire]; |
| 211 } | 210 } |
| 212 | 211 |
| 213 - (void)populateMenu { | 212 - (void)populateMenu { |
| 214 [menu_ setAutoenablesItems:NO]; | 213 [menu_ setAutoenablesItems:NO]; |
| 215 // 0-th item must be blank. (This is because we use a pulldown list, for which | 214 // 0-th item must be blank. (This is because we use a pulldown list, for which |
| 216 // Cocoa uses the 0-th item as "title" in the button.) | 215 // Cocoa uses the 0-th item as "title" in the button.) |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 | 257 |
| 259 @end // ReloadButton | 258 @end // ReloadButton |
| 260 | 259 |
| 261 @implementation ReloadButton (Testing) | 260 @implementation ReloadButton (Testing) |
| 262 | 261 |
| 263 + (void)setPendingReloadTimeout:(NSTimeInterval)seconds { | 262 + (void)setPendingReloadTimeout:(NSTimeInterval)seconds { |
| 264 kPendingReloadTimeout = seconds; | 263 kPendingReloadTimeout = seconds; |
| 265 } | 264 } |
| 266 | 265 |
| 267 @end | 266 @end |
| OLD | NEW |