OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SESSIONS_TAB_LOADER_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_SESSIONS_TAB_LOADER_DELEGATE_H_ |
6 #define CHROME_BROWSER_SESSIONS_TAB_LOADER_DELEGATE_H_ | 6 #define CHROME_BROWSER_SESSIONS_TAB_LOADER_DELEGATE_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 | 10 |
11 class TabLoaderCallback { | 11 class TabLoaderCallback { |
12 public: | 12 public: |
13 // This function will get called to suppress and to allow tab loading. Tab | 13 // This function will get called to suppress and to allow tab loading. Tab |
14 // loading is initially enabled. | 14 // loading is initially enabled. |
15 virtual void SetTabLoadingEnabled(bool enable_tab_loading) = 0; | 15 virtual void SetTabLoadingEnabled(bool enable_tab_loading) = 0; |
16 }; | 16 }; |
17 | 17 |
18 // TabLoaderDelegate is created once the SessionRestore process is complete and | 18 // TabLoaderDelegate is created once the SessionRestore process is complete and |
19 // the loading of hidden tabs starts. | 19 // the loading of hidden tabs starts. |
20 class TabLoaderDelegate { | 20 class TabLoaderDelegate { |
21 public: | 21 public: |
22 TabLoaderDelegate() {} | 22 TabLoaderDelegate() {} |
23 virtual ~TabLoaderDelegate() {} | 23 virtual ~TabLoaderDelegate() {} |
24 | 24 |
25 // Create a tab loader delegate. |TabLoaderCallback::SetTabLoadingEnabled| can | 25 // Create a tab loader delegate. |TabLoaderCallback::SetTabLoadingEnabled| can |
26 // get called to disable / enable tab loading. | 26 // get called to disable / enable tab loading. |
27 // The callback object is valid as long as this object exists. | 27 // The callback object is valid as long as this object exists. |
28 static scoped_ptr<TabLoaderDelegate> Create(TabLoaderCallback* callback); | 28 static scoped_ptr<TabLoaderDelegate> Create(TabLoaderCallback* callback); |
29 | 29 |
| 30 // Returns the default timeout time after which the first non-visible tab |
| 31 // gets loaded if the first (visible) tab did not finish loading. |
| 32 virtual base::TimeDelta GetFirstTabLoadingTimeout() const = 0; |
| 33 |
30 // Returns the default timeout time after which the next tab gets loaded if | 34 // Returns the default timeout time after which the next tab gets loaded if |
31 // the previous tab did not finish to load. | 35 // the previous tab did not finish loading. |
32 virtual base::TimeDelta GetTimeoutBeforeLoadingNextTab() const = 0; | 36 virtual base::TimeDelta GetTimeoutBeforeLoadingNextTab() const = 0; |
33 }; | 37 }; |
34 | 38 |
35 #endif // CHROME_BROWSER_SESSIONS_TAB_LOADER_DELEGATE_H_ | 39 #endif // CHROME_BROWSER_SESSIONS_TAB_LOADER_DELEGATE_H_ |
OLD | NEW |