| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 132   ToolbarButton::ShowDropDownMenu(source_type);  // Blocks. | 132   ToolbarButton::ShowDropDownMenu(source_type);  // Blocks. | 
| 133   ChangeMode(intended_mode_, true); | 133   ChangeMode(intended_mode_, true); | 
| 134 } | 134 } | 
| 135 | 135 | 
| 136 void ReloadButton::ButtonPressed(views::Button* /* button */, | 136 void ReloadButton::ButtonPressed(views::Button* /* button */, | 
| 137                                  const ui::Event& event) { | 137                                  const ui::Event& event) { | 
| 138   ClearPendingMenu(); | 138   ClearPendingMenu(); | 
| 139 | 139 | 
| 140   if (visible_mode_ == MODE_STOP) { | 140   if (visible_mode_ == MODE_STOP) { | 
| 141     if (command_updater_) | 141     if (command_updater_) | 
| 142       command_updater_->ExecuteCommandWithDisposition(IDC_STOP, CURRENT_TAB); | 142       command_updater_->ExecuteCommandWithDisposition( | 
|  | 143           IDC_STOP, WindowOpenDisposition::CURRENT_TAB); | 
| 143     // The user has clicked, so we can feel free to update the button, | 144     // The user has clicked, so we can feel free to update the button, | 
| 144     // even if the mouse is still hovering. | 145     // even if the mouse is still hovering. | 
| 145     ChangeMode(MODE_RELOAD, true); | 146     ChangeMode(MODE_RELOAD, true); | 
| 146   } else if (!double_click_timer_.IsRunning()) { | 147   } else if (!double_click_timer_.IsRunning()) { | 
| 147     // Shift-clicking or ctrl-clicking the reload button means we should ignore | 148     // Shift-clicking or ctrl-clicking the reload button means we should ignore | 
| 148     // any cached content. | 149     // any cached content. | 
| 149     int command; | 150     int command; | 
| 150     int flags = event.flags(); | 151     int flags = event.flags(); | 
| 151     if (event.IsShiftDown() || event.IsControlDown()) { | 152     if (event.IsShiftDown() || event.IsControlDown()) { | 
| 152       command = IDC_RELOAD_BYPASSING_CACHE; | 153       command = IDC_RELOAD_BYPASSING_CACHE; | 
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 262 | 263 | 
| 263 void ReloadButton::OnDoubleClickTimer() { | 264 void ReloadButton::OnDoubleClickTimer() { | 
| 264   if (!IsMenuShowing()) | 265   if (!IsMenuShowing()) | 
| 265     ChangeMode(intended_mode_, false); | 266     ChangeMode(intended_mode_, false); | 
| 266 } | 267 } | 
| 267 | 268 | 
| 268 void ReloadButton::OnStopToReloadTimer() { | 269 void ReloadButton::OnStopToReloadTimer() { | 
| 269   DCHECK(!IsMenuShowing()); | 270   DCHECK(!IsMenuShowing()); | 
| 270   ChangeMode(intended_mode_, true); | 271   ChangeMode(intended_mode_, true); | 
| 271 } | 272 } | 
| OLD | NEW | 
|---|