| 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 #include "chrome/browser/ui/views/reload_button.h" | 5 #include "chrome/browser/ui/views/reload_button.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/command_updater.h" | 9 #include "chrome/browser/command_updater.h" |
| 10 #include "chrome/browser/search/search.h" | 10 #include "chrome/browser/search/search.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 } | 163 } |
| 164 | 164 |
| 165 const char* ReloadButton::GetClassName() const { | 165 const char* ReloadButton::GetClassName() const { |
| 166 return kViewClassName; | 166 return kViewClassName; |
| 167 } | 167 } |
| 168 | 168 |
| 169 bool ReloadButton::ShouldShowMenu() { | 169 bool ReloadButton::ShouldShowMenu() { |
| 170 return menu_enabled_ && (visible_mode_ == MODE_RELOAD); | 170 return menu_enabled_ && (visible_mode_ == MODE_RELOAD); |
| 171 } | 171 } |
| 172 | 172 |
| 173 void ReloadButton::ShowDropDownMenu() { | 173 void ReloadButton::ShowDropDownMenu(ui::MenuSourceType source_type) { |
| 174 ButtonDropDown::ShowDropDownMenu(); // Blocks. | 174 ButtonDropDown::ShowDropDownMenu(source_type); // Blocks. |
| 175 ChangeMode(intended_mode_, true); | 175 ChangeMode(intended_mode_, true); |
| 176 } | 176 } |
| 177 | 177 |
| 178 //////////////////////////////////////////////////////////////////////////////// | 178 //////////////////////////////////////////////////////////////////////////////// |
| 179 // ReloadButton, ui::SimpleMenuModel::Delegate overrides: | 179 // ReloadButton, ui::SimpleMenuModel::Delegate overrides: |
| 180 | 180 |
| 181 bool ReloadButton::IsCommandIdChecked(int command_id) const { | 181 bool ReloadButton::IsCommandIdChecked(int command_id) const { |
| 182 return false; | 182 return false; |
| 183 } | 183 } |
| 184 | 184 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 | 259 |
| 260 void ReloadButton::OnDoubleClickTimer() { | 260 void ReloadButton::OnDoubleClickTimer() { |
| 261 if (!IsMenuShowing()) | 261 if (!IsMenuShowing()) |
| 262 ChangeMode(intended_mode_, false); | 262 ChangeMode(intended_mode_, false); |
| 263 } | 263 } |
| 264 | 264 |
| 265 void ReloadButton::OnStopToReloadTimer() { | 265 void ReloadButton::OnStopToReloadTimer() { |
| 266 DCHECK(!IsMenuShowing()); | 266 DCHECK(!IsMenuShowing()); |
| 267 ChangeMode(intended_mode_, true); | 267 ChangeMode(intended_mode_, true); |
| 268 } | 268 } |
| OLD | NEW |