blob: b4152133a1f63b1d011161e9d3af7dd3e850af2d [file] [log] [blame]
// Copyright (c) 2012 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 <stdint.h>
#include <string>
#include "build/build_config.h"
#include "components/content_settings/core/common/content_settings_types.h"
#include "url/gurl.h"
#if !defined(OS_ANDROID)
#include "chrome/browser/signin/signin_promo.h"
class Browser;
class Profile;
namespace chrome {
// Sources of requests to show the help tab.
enum HelpSource {
// Keyboard accelerators.
// Menus (e.g. app menu or Chrome OS system menu).
// WebUI (the "About" page).
// Sources of feedback requests.
// WARNING: The below enum MUST never be renamed, modified or reordered, as
// they're written to logs. You can only insert a new element immediately
// before the last.
enum FeedbackSource {
kFeedbackSourceArcApp = 0,
// Must be last.
void ShowBookmarkManager(Browser* browser);
void ShowBookmarkManagerForNode(Browser* browser, int64_t node_id);
void ShowHistory(Browser* browser);
void ShowDownloads(Browser* browser);
void ShowExtensions(Browser* browser,
const std::string& extension_to_highlight);
// ShowFeedbackPage() uses |browser| to determine the URL of the current tab.
// |browser| should be NULL if there are no currently open browser windows.
void ShowFeedbackPage(Browser* browser,
FeedbackSource source,
const std::string& description_template,
const std::string& description_placeholder_text,
const std::string& category_tag,
const std::string& extra_diagnostics);
void ShowHelp(Browser* browser, HelpSource source);
void ShowHelpForProfile(Profile* profile, HelpSource source);
void ShowBetaForum(Browser* browser);
void ShowPolicy(Browser* browser);
void ShowSlow(Browser* browser);
// Constructs a settings GURL for the specified |sub_page|.
GURL GetSettingsUrl(const std::string& sub_page);
// Returns true if |browser| is a trusted popup window containing a page with
// matching |scheme| (or any trusted popup if |scheme| is empty).
bool IsTrustedPopupWindowWithScheme(const Browser* browser,
const std::string& scheme);
// Various things that open in a settings UI.
// NOTE: For Chrome OS settings, use SettingsWindowManager::ShowOSSettings().
void ShowSettings(Browser* browser);
void ShowSettingsSubPage(Browser* browser, const std::string& sub_page);
void ShowSettingsSubPageForProfile(Profile* profile,
const std::string& sub_page);
void ShowContentSettingsExceptions(Browser* browser,
ContentSettingsType content_settings_type);
void ShowContentSettingsExceptionsForProfile(
Profile* profile,
ContentSettingsType content_settings_type);
void ShowSiteSettings(Profile* profile, const GURL& url);
void ShowSiteSettings(Browser* browser, const GURL& url);
void ShowAppManagementPage(Profile* profile, const std::string& app_id);
void ShowContentSettings(Browser* browser,
ContentSettingsType content_settings_type);
void ShowSettingsSubPageInTabbedBrowser(Browser* browser,
const std::string& sub_page);
void ShowClearBrowsingDataDialog(Browser* browser);
void ShowPasswordManager(Browser* browser);
void ShowImportDialog(Browser* browser);
void ShowAboutChrome(Browser* browser);
void ShowSearchEngineSettings(Browser* browser);
#if defined(OS_CHROMEOS)
void ShowManagementPageForProfile(Profile* profile);
#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
// Initiates signin in a new browser tab.
void ShowBrowserSignin(Browser* browser,
signin_metrics::AccessPoint access_point);
// If the user is already signed in, shows the "Signin" portion of Settings,
// otherwise initiates signin in a new browser tab.
void ShowBrowserSigninOrSettings(Browser* browser,
signin_metrics::AccessPoint access_point);
} // namespace chrome