OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chrome/browser/ui/views/toolbar/reload_button.h" | 5 #include "chrome/browser/ui/views/toolbar/reload_button.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 "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 } | 174 } |
175 | 175 |
176 bool ReloadButton::IsCommandIdEnabled(int command_id) const { | 176 bool ReloadButton::IsCommandIdEnabled(int command_id) const { |
177 return true; | 177 return true; |
178 } | 178 } |
179 | 179 |
180 bool ReloadButton::IsCommandIdVisible(int command_id) const { | 180 bool ReloadButton::IsCommandIdVisible(int command_id) const { |
181 return true; | 181 return true; |
182 } | 182 } |
183 | 183 |
184 bool ReloadButton::GetAcceleratorForCommandId(int command_id, | 184 bool ReloadButton::GetAcceleratorForCommandId( |
185 ui::Accelerator* accelerator) { | 185 int command_id, |
| 186 ui::Accelerator* accelerator) const { |
186 switch (command_id) { | 187 switch (command_id) { |
187 case IDS_RELOAD_MENU_NORMAL_RELOAD_ITEM: | 188 case IDS_RELOAD_MENU_NORMAL_RELOAD_ITEM: |
188 GetWidget()->GetAccelerator(IDC_RELOAD, accelerator); | 189 GetWidget()->GetAccelerator(IDC_RELOAD, accelerator); |
189 return true; | 190 return true; |
190 case IDS_RELOAD_MENU_HARD_RELOAD_ITEM: | 191 case IDS_RELOAD_MENU_HARD_RELOAD_ITEM: |
191 GetWidget()->GetAccelerator(IDC_RELOAD_BYPASSING_CACHE, accelerator); | 192 GetWidget()->GetAccelerator(IDC_RELOAD_BYPASSING_CACHE, accelerator); |
192 return true; | 193 return true; |
193 } | 194 } |
194 return GetWidget()->GetAccelerator(command_id, accelerator); | 195 return GetWidget()->GetAccelerator(command_id, accelerator); |
195 } | 196 } |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 262 |
262 void ReloadButton::OnDoubleClickTimer() { | 263 void ReloadButton::OnDoubleClickTimer() { |
263 if (!IsMenuShowing()) | 264 if (!IsMenuShowing()) |
264 ChangeMode(intended_mode_, false); | 265 ChangeMode(intended_mode_, false); |
265 } | 266 } |
266 | 267 |
267 void ReloadButton::OnStopToReloadTimer() { | 268 void ReloadButton::OnStopToReloadTimer() { |
268 DCHECK(!IsMenuShowing()); | 269 DCHECK(!IsMenuShowing()); |
269 ChangeMode(intended_mode_, true); | 270 ChangeMode(intended_mode_, true); |
270 } | 271 } |
OLD | NEW |