summaryrefslogtreecommitdiffstats
path: root/content/public/common/url_utils.cc
blob: 2f08b9650b63a10b92353909eaa8a1b5b9f44cb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/public/common/url_utils.h"

#include "build/build_config.h"
#include "content/common/savable_url_schemes.h"
#include "content/public/common/url_constants.h"
#include "url/gurl.h"

namespace content {

const char* const* GetSavableSchemes() {
  return GetSavableSchemesInternal();
}

bool HasWebUIScheme(const GURL& url) {
  return
#if !defined(OS_IOS)
         url.SchemeIs(chrome::kChromeDevToolsScheme) ||
         url.SchemeIs(chrome::kChromeInternalScheme) ||
#endif
         url.SchemeIs(chrome::kChromeUIScheme);
}

bool IsSavableURL(const GURL& url) {
  for (int i = 0; GetSavableSchemes()[i] != NULL; ++i) {
    if (url.SchemeIs(GetSavableSchemes()[i]))
      return true;
  }
  return false;
}

}  // namespace content