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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 } | 105 } |
106 | 106 |
107 SchedulePaint(); | 107 SchedulePaint(); |
108 PreferredSizeChanged(); | 108 PreferredSizeChanged(); |
109 } | 109 } |
110 | 110 |
111 //////////////////////////////////////////////////////////////////////////////// | 111 //////////////////////////////////////////////////////////////////////////////// |
112 // ReloadButton, views::ButtonListener implementation: | 112 // ReloadButton, views::ButtonListener implementation: |
113 | 113 |
114 void ReloadButton::ButtonPressed(views::Button* /* button */, | 114 void ReloadButton::ButtonPressed(views::Button* /* button */, |
115 const views::Event& event) { | 115 const ui::Event& event) { |
116 ClearPendingMenu(); | 116 ClearPendingMenu(); |
117 | 117 |
118 if (visible_mode_ == MODE_STOP) { | 118 if (visible_mode_ == MODE_STOP) { |
119 if (command_updater_) | 119 if (command_updater_) |
120 command_updater_->ExecuteCommandWithDisposition(IDC_STOP, CURRENT_TAB); | 120 command_updater_->ExecuteCommandWithDisposition(IDC_STOP, CURRENT_TAB); |
121 // The user has clicked, so we can feel free to update the button, | 121 // The user has clicked, so we can feel free to update the button, |
122 // even if the mouse is still hovering. | 122 // even if the mouse is still hovering. |
123 ChangeMode(MODE_RELOAD, true); | 123 ChangeMode(MODE_RELOAD, true); |
124 } else if (!double_click_timer_.IsRunning()) { | 124 } else if (!double_click_timer_.IsRunning()) { |
125 // Shift-clicking or ctrl-clicking the reload button means we should ignore | 125 // Shift-clicking or ctrl-clicking the reload button means we should ignore |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 | 268 |
269 void ReloadButton::OnDoubleClickTimer() { | 269 void ReloadButton::OnDoubleClickTimer() { |
270 if (!IsMenuShowing()) | 270 if (!IsMenuShowing()) |
271 ChangeMode(intended_mode_, false); | 271 ChangeMode(intended_mode_, false); |
272 } | 272 } |
273 | 273 |
274 void ReloadButton::OnStopToReloadTimer() { | 274 void ReloadButton::OnStopToReloadTimer() { |
275 DCHECK(!IsMenuShowing()); | 275 DCHECK(!IsMenuShowing()); |
276 ChangeMode(intended_mode_, true); | 276 ChangeMode(intended_mode_, true); |
277 } | 277 } |
OLD | NEW |