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

Side by Side Diff: chrome/browser/captive_portal/captive_portal_tab_reloader.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
OLDNEW
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 #ifndef CHROME_BROWSER_CAPTIVE_PORTAL_CAPTIVE_PORTAL_TAB_RELOADER_H_ 5 #ifndef CHROME_BROWSER_CAPTIVE_PORTAL_CAPTIVE_PORTAL_TAB_RELOADER_H_
6 #define CHROME_BROWSER_CAPTIVE_PORTAL_CAPTIVE_PORTAL_TAB_RELOADER_H_ 6 #define CHROME_BROWSER_CAPTIVE_PORTAL_CAPTIVE_PORTAL_TAB_RELOADER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/callback_forward.h" 9 #include "base/callback_forward.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 content::WebContents* web_contents() { return web_contents_; } 119 content::WebContents* web_contents() { return web_contents_; }
120 120
121 void set_slow_ssl_load_time(base::TimeDelta slow_ssl_load_time) { 121 void set_slow_ssl_load_time(base::TimeDelta slow_ssl_load_time) {
122 slow_ssl_load_time_ = slow_ssl_load_time; 122 slow_ssl_load_time_ = slow_ssl_load_time;
123 } 123 }
124 124
125 // Started whenever an SSL tab starts loading, when the state is switched to 125 // Started whenever an SSL tab starts loading, when the state is switched to
126 // STATE_TIMER_RUNNING. Stopped on any state change, including when a page 126 // STATE_TIMER_RUNNING. Stopped on any state change, including when a page
127 // commits or there's an error. If the timer triggers, the state switches to 127 // commits or there's an error. If the timer triggers, the state switches to
128 // STATE_MAYBE_BROKEN_BY_PORTAL and |this| kicks off a captive portal check. 128 // STATE_MAYBE_BROKEN_BY_PORTAL and |this| kicks off a captive portal check.
129 base::OneShotTimer<CaptivePortalTabReloader> slow_ssl_load_timer_; 129 base::OneShotTimer slow_ssl_load_timer_;
130 130
131 private: 131 private:
132 friend class CaptivePortalBrowserTest; 132 friend class CaptivePortalBrowserTest;
133 133
134 // Sets |state_| and takes any action associated with the new state. Also 134 // Sets |state_| and takes any action associated with the new state. Also
135 // stops the timer, if needed. 135 // stops the timer, if needed.
136 void SetState(State new_state); 136 void SetState(State new_state);
137 137
138 // Called by a timer when an SSL main frame provisional load is taking a 138 // Called by a timer when an SSL main frame provisional load is taking a
139 // while to commit. 139 // while to commit.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 base::TimeDelta slow_ssl_load_time_; 177 base::TimeDelta slow_ssl_load_time_;
178 178
179 const OpenLoginTabCallback open_login_tab_callback_; 179 const OpenLoginTabCallback open_login_tab_callback_;
180 180
181 base::WeakPtrFactory<CaptivePortalTabReloader> weak_factory_; 181 base::WeakPtrFactory<CaptivePortalTabReloader> weak_factory_;
182 182
183 DISALLOW_COPY_AND_ASSIGN(CaptivePortalTabReloader); 183 DISALLOW_COPY_AND_ASSIGN(CaptivePortalTabReloader);
184 }; 184 };
185 185
186 #endif // CHROME_BROWSER_CAPTIVE_PORTAL_CAPTIVE_PORTAL_TAB_RELOADER_H_ 186 #endif // CHROME_BROWSER_CAPTIVE_PORTAL_CAPTIVE_PORTAL_TAB_RELOADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698