Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 IOS_CHROME_BROWSER_READING_LIST_OFFLINE_URL_UTILS_H_ | 5 #ifndef IOS_CHROME_BROWSER_READING_LIST_OFFLINE_URL_UTILS_H_ |
| 6 #define IOS_CHROME_BROWSER_READING_LIST_OFFLINE_URL_UTILS_H_ | 6 #define IOS_CHROME_BROWSER_READING_LIST_OFFLINE_URL_UTILS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
| 13 | 13 |
| 14 namespace reading_list { | 14 namespace reading_list { |
| 15 | 15 |
| 16 // The distilled URL chrome://offline/... that will load the file at |path|. | 16 // The distilled URL chrome://offline/... that will load the file at |path|. |
| 17 GURL DistilledURLForPath(const base::FilePath& path, const GURL& virtual_url); | 17 // |entry_url| is the URL of the ReadingListEntry. |
| 18 // |virtual_url| is the URL to display in the omnibox. | |
| 19 GURL OfflineURLForPath(const base::FilePath& distilled_path, | |
|
gambard
2017/01/20 14:49:34
Can you change the function name? You obscure the
jif
2017/01/20 15:01:25
Consider explaining why |entry_url| can be differe
Olivier
2017/01/20 16:09:14
Done.
Olivier
2017/01/20 16:09:14
C++ function names don't always include parameters
| |
| 20 const GURL& entry_url, | |
| 21 const GURL& virtual_url); | |
| 18 | 22 |
| 19 // If |distilled_url| has a query "virtualURL" query params that is a URL, | 23 // If |offline_url| has a "virtualURL" query params that is a URL, returns it. |
| 20 // returns it. If not, return |distilled_url| | 24 // If not, return |EntryURLForOfflineURL(|offline_url|)| |
| 21 GURL VirtualURLForDistilledURL(const GURL& distilled_url); | 25 GURL VirtualURLForOfflineURL(const GURL& offline_url); |
| 26 | |
| 27 // If |offline_url| has a "entryURL" query params that is a URL, returns it. | |
| 28 // If not, return |offline_url| | |
| 29 GURL EntryURLForOfflineURL(const GURL& offline_url); | |
|
gambard
2017/01/20 14:49:34
Can you please set the same function order in .h a
Olivier
2017/01/20 16:09:14
Done.
| |
| 22 | 30 |
| 23 // The file URL pointing to the local file to load to display |distilled_url|. | 31 // The file URL pointing to the local file to load to display |distilled_url|. |
| 24 // If |resources_root_url| is not nullptr, it is set to a file URL to the | 32 // If |resources_root_url| is not nullptr, it is set to a file URL to the |
| 25 // directory conatining all the resources needed by |distilled_url|. | 33 // directory conatining all the resources needed by |distilled_url|. |
| 26 // |offline_path| is the root path to the directory containing offline files. | 34 // |offline_path| is the root path to the directory containing offline files. |
| 27 GURL FileURLForDistilledURL(const GURL& distilled_url, | 35 GURL FileURLForDistilledURL(const GURL& distilled_url, |
| 28 const base::FilePath& offline_path, | 36 const base::FilePath& offline_path, |
| 29 GURL* resources_root_url); | 37 GURL* resources_root_url); |
| 30 | 38 |
| 31 // Returns whether the URL points to a chrome offline URL. | 39 // Returns whether the URL points to a chrome offline URL. |
| 32 bool IsOfflineURL(const GURL& url); | 40 bool IsOfflineURL(const GURL& url); |
| 33 | 41 |
| 34 } // namespace reading_list | 42 } // namespace reading_list |
| 35 | 43 |
| 36 #endif // IOS_CHROME_BROWSER_READING_LIST_OFFLINE_URL_UTILS_H_ | 44 #endif // IOS_CHROME_BROWSER_READING_LIST_OFFLINE_URL_UTILS_H_ |
| OLD | NEW |