OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_OFFLINER_USER_DATA_H_ | |
6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_OFFLINER_USER_DATA_H_ | |
7 | |
8 #include "components/offline_pages/core/background/offliner.h" | |
9 #include "content/public/browser/web_contents_user_data.h" | |
10 | |
11 namespace offline_pages { | |
12 | |
13 class OfflinerUserData : public content::WebContentsUserData<OfflinerUserData> { | |
Pete Williamson
2017/05/16 17:51:19
Reviewers: This is a kind of odd place for the Us
RyanSturm
2017/05/16 17:56:30
If this is just because it wasn't building resourc
Pete Williamson
2017/05/17 16:53:42
And the file is now moved to its new home, chrome/
| |
14 public: | |
15 static void AddToWebContents(content::WebContents* webcontents, | |
16 Offliner* offliner); | |
17 | |
18 static Offliner* OfflinerFromWebContents(content::WebContents* webcontents); | |
19 | |
20 explicit OfflinerUserData(Offliner* offliner) { offliner_ = offliner; } | |
21 Offliner* offliner() { return offliner_; } | |
22 | |
23 private: | |
24 // The offliner that the WebContents is attached to. The offliner owns the | |
25 // Delegate which owns the WebContents that this data is attached to. | |
26 // Therefore, its lifetime should exceed that of the WebContents, so this | |
27 // should always be non-null. | |
28 Offliner* offliner_; | |
29 }; | |
30 | |
31 } // namespace offline_pages | |
32 | |
33 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_OFFLINER_USER_DATA_H_ | |
OLD | NEW |