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

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

Issue 464973002: JavaScript that returns whether or not a page is an article (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed names to distillable 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 #include "components/dom_distiller/core/url_utils.h" 5 #include "components/dom_distiller/core/url_utils.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/guid.h" 9 #include "base/guid.h"
10 #include "components/dom_distiller/core/url_constants.h" 10 #include "components/dom_distiller/core/url_constants.h"
11 #include "grit/component_resources.h"
11 #include "net/base/url_util.h" 12 #include "net/base/url_util.h"
13 #include "ui/base/resource/resource_bundle.h"
12 #include "url/gurl.h" 14 #include "url/gurl.h"
13 15
14 namespace dom_distiller { 16 namespace dom_distiller {
15 17
16 namespace url_utils { 18 namespace url_utils {
17 19
18 namespace { 20 namespace {
19 21
20 const char kDummyInternalUrlPrefix[] = "chrome-distiller-internal://dummy/"; 22 const char kDummyInternalUrlPrefix[] = "chrome-distiller-internal://dummy/";
21 23
(...skipping 22 matching lines...) Expand all
44 } 46 }
45 47
46 bool IsUrlDistillable(const GURL& url) { 48 bool IsUrlDistillable(const GURL& url) {
47 return url.is_valid() && url.SchemeIsHTTPOrHTTPS(); 49 return url.is_valid() && url.SchemeIsHTTPOrHTTPS();
48 } 50 }
49 51
50 bool IsDistilledPage(const GURL& url) { 52 bool IsDistilledPage(const GURL& url) {
51 return url.is_valid() && url.scheme() == kDomDistillerScheme; 53 return url.is_valid() && url.scheme() == kDomDistillerScheme;
52 } 54 }
53 55
56 std::string GetIsDistillableJs() {
57 return ResourceBundle::GetSharedInstance()
58 .GetRawDataResource(IDR_IS_DISTILLABLE_JS).as_string();
59 }
60
54 } // namespace url_utils 61 } // namespace url_utils
55 62
56 } // namespace dom_distiller 63 } // namespace dom_distiller
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698