| 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/utf_string_conversions.h" | 7 #include "base/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/event_disposition.h" | 10 #include "chrome/browser/event_disposition.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 int flags = mouse_event_flags(); | 92 int flags = mouse_event_flags(); |
| 93 if (event.IsShiftDown() || event.IsControlDown()) { | 93 if (event.IsShiftDown() || event.IsControlDown()) { |
| 94 command = IDC_RELOAD_IGNORING_CACHE; | 94 command = IDC_RELOAD_IGNORING_CACHE; |
| 95 // Mask off Shift and Control so they don't affect the disposition below. | 95 // Mask off Shift and Control so they don't affect the disposition below. |
| 96 flags &= ~(ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN); | 96 flags &= ~(ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN); |
| 97 } else { | 97 } else { |
| 98 command = IDC_RELOAD; | 98 command = IDC_RELOAD; |
| 99 } | 99 } |
| 100 | 100 |
| 101 WindowOpenDisposition disposition = | 101 WindowOpenDisposition disposition = |
| 102 browser::DispositionFromEventFlags(flags); | 102 chrome::DispositionFromEventFlags(flags); |
| 103 if ((disposition == CURRENT_TAB) && location_bar_) { | 103 if ((disposition == CURRENT_TAB) && location_bar_) { |
| 104 // Forcibly reset the location bar, since otherwise it won't discard any | 104 // Forcibly reset the location bar, since otherwise it won't discard any |
| 105 // ongoing user edits, since it doesn't realize this is a user-initiated | 105 // ongoing user edits, since it doesn't realize this is a user-initiated |
| 106 // action. | 106 // action. |
| 107 location_bar_->Revert(); | 107 location_bar_->Revert(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 // Start a timer - while this timer is running, the reload button cannot be | 110 // Start a timer - while this timer is running, the reload button cannot be |
| 111 // changed to a stop button. We do not set |intended_mode_| to MODE_STOP | 111 // changed to a stop button. We do not set |intended_mode_| to MODE_STOP |
| 112 // here as the browser will do that when it actually starts loading (which | 112 // here as the browser will do that when it actually starts loading (which |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 //////////////////////////////////////////////////////////////////////////////// | 145 //////////////////////////////////////////////////////////////////////////////// |
| 146 // ReloadButton, private: | 146 // ReloadButton, private: |
| 147 | 147 |
| 148 void ReloadButton::OnDoubleClickTimer() { | 148 void ReloadButton::OnDoubleClickTimer() { |
| 149 ChangeMode(intended_mode_, false); | 149 ChangeMode(intended_mode_, false); |
| 150 } | 150 } |
| 151 | 151 |
| 152 void ReloadButton::OnStopToReloadTimer() { | 152 void ReloadButton::OnStopToReloadTimer() { |
| 153 ChangeMode(intended_mode_, true); | 153 ChangeMode(intended_mode_, true); |
| 154 } | 154 } |
| OLD | NEW |