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

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

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 2 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
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.h ('k') | chrome/browser/ui/webui/about_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_RELOAD_BUTTON_H__ 5 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_RELOAD_BUTTON_H__
6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_RELOAD_BUTTON_H__ 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_RELOAD_BUTTON_H__
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/gtest_prod_util.h" 9 #include "base/gtest_prod_util.h"
10 #include "base/timer/timer.h" 10 #include "base/timer/timer.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 friend class ReloadButtonTest; 71 friend class ReloadButtonTest;
72 72
73 ui::SimpleMenuModel* CreateMenuModel(); 73 ui::SimpleMenuModel* CreateMenuModel();
74 74
75 void ExecuteBrowserCommand(int command, int event_flags); 75 void ExecuteBrowserCommand(int command, int event_flags);
76 void ChangeModeInternal(Mode mode); 76 void ChangeModeInternal(Mode mode);
77 77
78 void OnDoubleClickTimer(); 78 void OnDoubleClickTimer();
79 void OnStopToReloadTimer(); 79 void OnStopToReloadTimer();
80 80
81 base::OneShotTimer<ReloadButton> double_click_timer_; 81 base::OneShotTimer double_click_timer_;
82 base::OneShotTimer<ReloadButton> stop_to_reload_timer_; 82 base::OneShotTimer stop_to_reload_timer_;
83 83
84 // This may be NULL when testing. 84 // This may be NULL when testing.
85 CommandUpdater* command_updater_; 85 CommandUpdater* command_updater_;
86 86
87 // The mode we should be in assuming no timers are running. 87 // The mode we should be in assuming no timers are running.
88 Mode intended_mode_; 88 Mode intended_mode_;
89 89
90 // The currently-visible mode - this may differ from the intended mode. 90 // The currently-visible mode - this may differ from the intended mode.
91 Mode visible_mode_; 91 Mode visible_mode_;
92 92
93 // The delay times for the timers. These are members so that tests can modify 93 // The delay times for the timers. These are members so that tests can modify
94 // them. 94 // them.
95 base::TimeDelta double_click_timer_delay_; 95 base::TimeDelta double_click_timer_delay_;
96 base::TimeDelta stop_to_reload_timer_delay_; 96 base::TimeDelta stop_to_reload_timer_delay_;
97 97
98 // Indicates if reload menu is enabled. 98 // Indicates if reload menu is enabled.
99 bool menu_enabled_; 99 bool menu_enabled_;
100 100
101 // TESTING ONLY 101 // TESTING ONLY
102 // True if we should pretend the button is hovered. 102 // True if we should pretend the button is hovered.
103 bool testing_mouse_hovered_; 103 bool testing_mouse_hovered_;
104 // Increments when we would tell the browser to "reload", so 104 // Increments when we would tell the browser to "reload", so
105 // test code can tell whether we did so (as there may be no |browser_|). 105 // test code can tell whether we did so (as there may be no |browser_|).
106 int testing_reload_count_; 106 int testing_reload_count_;
107 107
108 DISALLOW_IMPLICIT_CONSTRUCTORS(ReloadButton); 108 DISALLOW_IMPLICIT_CONSTRUCTORS(ReloadButton);
109 }; 109 };
110 110
111 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_RELOAD_BUTTON_H__ 111 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_RELOAD_BUTTON_H__
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.h ('k') | chrome/browser/ui/webui/about_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698