Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: chrome/browser/ui/views/toolbar/reload_button.cc

Issue 2248873002: Convert WindowOpenDisposition to an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/task_manager_view_browsertest.cc ('k') | chrome/browser/ui/views/translate/translate_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698