Chromium Code Reviews| 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_OFFLINE_PAGES_OFFLINER_USER_DATA_H_ | |
| 6 #define CHROME_BROWSER_OFFLINE_PAGES_OFFLINER_USER_DATA_H_ | |
| 7 | |
| 8 #include "chrome/browser/offline_pages/resource_loading_observer.h" | |
| 9 #include "components/offline_pages/core/background/offliner.h" | |
| 10 #include "components/offline_pages/features/features.h" | |
| 11 #include "content/public/browser/web_contents_user_data.h" | |
| 12 | |
| 13 namespace offline_pages { | |
| 14 | |
| 15 class OfflinerUserData : public content::WebContentsUserData<OfflinerUserData> { | |
| 16 public: | |
| 17 static void AddToWebContents(content::WebContents* webcontents, | |
| 18 Offliner* offliner); | |
| 19 | |
| 20 static Offliner* OfflinerFromWebContents(content::WebContents* webcontents); | |
| 21 | |
| 22 static ResourceLoadingObserver* ResourceTrackerObserverFromWebContents( | |
|
RyanSturm
2017/06/16 17:04:45
s/ResourceTrackerObserverFromWebContents/ResourceL
Pete Williamson
2017/06/16 21:16:15
Done.
| |
| 23 content::WebContents* webcontents); | |
| 24 | |
| 25 explicit OfflinerUserData(Offliner* offliner) { offliner_ = offliner; } | |
| 26 Offliner* offliner() { return offliner_; } | |
|
RyanSturm
2017/06/16 17:04:45
Why the switch from BackgroundOffliner to Offliner
Pete Williamson
2017/06/16 21:16:15
Done (or rather undone, in this case ^_^)
The ori
| |
| 27 | |
| 28 private: | |
| 29 // The offliner that the WebContents is attached to. The offliner owns the | |
| 30 // Delegate which owns the WebContents that this data is attached to. | |
| 31 // Therefore, its lifetime should exceed that of the WebContents, so this | |
| 32 // should always be non-null. | |
| 33 Offliner* offliner_; | |
| 34 }; | |
| 35 | |
| 36 } // namespace offline_pages | |
| 37 | |
| 38 #endif // CHROME_BROWSER_OFFLINE_PAGES_OFFLINER_USER_DATA_H_ | |
| OLD | NEW |