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

Side by Side Diff: components/dom_distiller/core/url_utils.h

Issue 442503002: Retrieve article original URL from entryID (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: string reference Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_DOM_DISTILLER_CORE_URL_UTILS_H_ 5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_URL_UTILS_H_
6 #define COMPONENTS_DOM_DISTILLER_CORE_URL_UTILS_H_ 6 #define COMPONENTS_DOM_DISTILLER_CORE_URL_UTILS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 class GURL; 10 class GURL;
11 11
12 namespace dom_distiller { 12 namespace dom_distiller {
13 13
14 namespace url_utils { 14 namespace url_utils {
15 15
16 // Returns the URL for viewing distilled content for an entry. 16 // Returns the URL for viewing distilled content for an entry.
17 const GURL GetDistillerViewUrlFromEntryId(const std::string& scheme, 17 const GURL GetDistillerViewUrlFromEntryId(const std::string& scheme,
18 const std::string& entry_id); 18 const std::string& entry_id);
19 19
20 // Returns the URL for viewing distilled content for a URL. 20 // Returns the URL for viewing distilled content for a URL.
21 const GURL GetDistillerViewUrlFromUrl(const std::string& scheme, 21 const GURL GetDistillerViewUrlFromUrl(const std::string& scheme,
22 const GURL& view_url); 22 const GURL& view_url);
23 23
24 // Returns the value of the query parameter for the given |key| for a given URL.
25 // If the URL is invalid or if the key is not found, returns an empty string.
26 // If there are multiple keys found in the URL, returns the value for the first
27 // key.
28 std::string GetValueForKeyInUrl(const GURL& url, const std::string& key);
29
24 // Returns the value of the query parameter for the given path. 30 // Returns the value of the query parameter for the given path.
25 std::string GetValueForKeyInUrlPathQuery(const std::string& path, 31 std::string GetValueForKeyInUrlPathQuery(const std::string& path,
26 const std::string& key); 32 const std::string& key);
27 33
28 // Returns whether it should be possible to distill the given |url|. 34 // Returns whether it should be possible to distill the given |url|.
29 bool IsUrlDistillable(const GURL& url); 35 bool IsUrlDistillable(const GURL& url);
30 36
31 // Returns whether the given |url| is for a distilled page. 37 // Returns whether the given |url| is for a distilled page.
32 bool IsDistilledPage(const GURL& url); 38 bool IsDistilledPage(const GURL& url);
33 39
34 // Returns a JavaScript snippet that returns whether or not a page should be 40 // Returns a JavaScript snippet that returns whether or not a page should be
35 // used with DomDistillerService and can be executed in a live page. 41 // used with DomDistillerService and can be executed in a live page.
36 std::string GetIsDistillableJs(); 42 std::string GetIsDistillableJs();
37 43
38 } // namespace url_utils 44 } // namespace url_utils
39 45
40 } // namespace dom_distiller 46 } // namespace dom_distiller
41 47
42 #endif // COMPONENTS_DOM_DISTILLER_CORE_URL_UTILS_H_ 48 #endif // COMPONENTS_DOM_DISTILLER_CORE_URL_UTILS_H_
OLDNEW
« no previous file with comments | « components/dom_distiller/core/dom_distiller_service_unittest.cc ('k') | components/dom_distiller/core/url_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698