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

Side by Side Diff: chrome/browser/sessions/session_restore_delegate.h

Issue 1131373003: [Session restore] Add MRU logic to loading of background pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_SESSION_RESTORE_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_SESSIONS_SESSION_RESTORE_DELEGATE_H_
6 #define CHROME_BROWSER_SESSIONS_SESSION_RESTORE_DELEGATE_H_ 6 #define CHROME_BROWSER_SESSIONS_SESSION_RESTORE_DELEGATE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/time/time.h" 10 #include "base/time/time.h"
11 11
12 namespace content { 12 namespace content {
13 class WebContents; 13 class WebContents;
14 } 14 }
15 15
16 // SessionRestoreDelegate is responsible for creating the tab loader and the 16 // SessionRestoreDelegate is responsible for creating the tab loader and the
17 // stats collector. 17 // stats collector.
18 class SessionRestoreDelegate { 18 class SessionRestoreDelegate {
19 public: 19 public:
20 class RestoredTab { 20 class RestoredTab {
21 public: 21 public:
22 RestoredTab(content::WebContents* contents, 22 RestoredTab(content::WebContents* contents,
23 bool is_active, 23 bool is_active,
24 bool is_app, 24 bool is_app,
25 bool is_pinned); 25 bool is_pinned,
26 base::TimeTicks last_activation_time);
sky 2015/05/12 21:25:30 If you push this to the WebContents, do you need i
Georges Khalil 2015/05/15 16:55:30 Good catch. Pushing to WebContents was added at t
26 27
27 bool operator<(const RestoredTab& right) const; 28 bool operator<(const RestoredTab& right) const;
28 29
29 content::WebContents* contents() const { return contents_; } 30 content::WebContents* contents() const { return contents_; }
30 bool is_active() const { return is_active_; } 31 bool is_active() const { return is_active_; }
31 bool is_app() const { return is_app_; } 32 bool is_app() const { return is_app_; }
32 bool is_internal_page() const { return is_internal_page_; } 33 bool is_internal_page() const { return is_internal_page_; }
33 bool is_pinned() const { return is_pinned_; } 34 bool is_pinned() const { return is_pinned_; }
35 base::TimeTicks last_activation_time() const {
36 return last_activation_time_;
37 }
34 38
35 private: 39 private:
36 content::WebContents* contents_; 40 content::WebContents* contents_;
37 bool is_active_; 41 bool is_active_;
38 bool is_app_; // Browser window is an app. 42 bool is_app_; // Browser window is an app.
39 bool is_internal_page_; // Internal web UI page, like NTP or Settings. 43 bool is_internal_page_; // Internal web UI page, like NTP or Settings.
40 bool is_pinned_; 44 bool is_pinned_;
45 base::TimeTicks last_activation_time_;
41 }; 46 };
42 47
43 static void RestoreTabs(const std::vector<RestoredTab>& tabs, 48 static void RestoreTabs(const std::vector<RestoredTab>& tabs,
44 const base::TimeTicks& restore_started); 49 const base::TimeTicks& restore_started);
45 50
46 private: 51 private:
47 DISALLOW_IMPLICIT_CONSTRUCTORS(SessionRestoreDelegate); 52 DISALLOW_IMPLICIT_CONSTRUCTORS(SessionRestoreDelegate);
48 }; 53 };
49 54
50 #endif // CHROME_BROWSER_SESSIONS_SESSION_RESTORE_DELEGATE_H_ 55 #endif // CHROME_BROWSER_SESSIONS_SESSION_RESTORE_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698