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 #include "chrome/browser/offline_pages/offliner_user_data.h" | |
| 6 | |
| 7 namespace offline_pages { | |
| 8 | |
| 9 void OfflinerUserData::AddToWebContents(content::WebContents* webcontents, | |
| 10 Offliner* offliner) { | |
| 11 DCHECK(offliner); | |
| 12 webcontents->SetUserData(UserDataKey(), std::unique_ptr<OfflinerUserData>( | |
| 13 new OfflinerUserData(offliner))); | |
|
Dmitry Titov
2017/05/24 23:09:34
formatting...
git cl format?
| |
| 14 } | |
| 15 | |
| 16 // static | |
| 17 Offliner* OfflinerUserData::OfflinerFromWebContents( | |
| 18 content::WebContents* webcontents) { | |
| 19 OfflinerUserData* data = OfflinerUserData::FromWebContents(webcontents); | |
| 20 if (data) | |
| 21 return data->offliner(); | |
| 22 | |
| 23 return nullptr; | |
| 24 } | |
| 25 | |
| 26 } // namespace offline_pages | |
| 27 | |
| 28 DEFINE_WEB_CONTENTS_USER_DATA_KEY(offline_pages::OfflinerUserData); | |
| OLD | NEW |