summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/net/net_error_diagnostics_dialog.h
blob: 6b2f88cba88b26f9f960812763012f1933c5260d (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
// Copyright 2015 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.

#ifndef CHROME_BROWSER_NET_NET_ERROR_DIAGNOSTICS_DIALOG_H_
#define CHROME_BROWSER_NET_NET_ERROR_DIAGNOSTICS_DIALOG_H_

#include <string>

namespace content {
class WebContents;
}

// Returns true if a tool for diagnosing network errors encountered when
// requesting URLs can be shown for the provided WebContents. The ability to
// show the diagnostic tool depends on the host platform, and whether the
// WebContents is incognito.
bool CanShowNetworkDiagnosticsDialog(content::WebContents* web_contents);

// Shows a dialog for investigating an error received when requesting
// |failed_url|.  May only be called when CanShowNetworkDiagnosticsDialog()
// returns true.  The caller is responsible for sanitizing the url.
void ShowNetworkDiagnosticsDialog(content::WebContents* web_contents,
                                  const std::string& failed_url);

#endif  // CHROME_BROWSER_NET_NET_ERROR_DIAGNOSTICS_DIALOG_H_