chromium/chrome/browser/extensions/api/tabs/tabs_api.h

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_
#define CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_

#include <string>
#include <vector>

#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/values.h"
#include "chrome/browser/extensions/chrome_extension_function_details.h"
#include "chrome/common/extensions/api/tabs.h"
#include "components/translate/core/browser/translate_driver.h"
#include "components/zoom/zoom_controller.h"
#include "content/public/browser/web_contents_observer.h"
#include "extensions/browser/api/execute_code_function.h"
#include "extensions/browser/api/web_contents_capture_client.h"
#include "extensions/browser/extension_function.h"
#include "extensions/common/extension_resource.h"
#include "extensions/common/user_script.h"
#include "url/gurl.h"

class GURL;
class SkBitmap;
class TabStripModel;

namespace base {
class TaskRunner;
}

namespace content {
class WebContents;
}

namespace ui {
class ListSelectionModel;
}

namespace user_prefs {
class PrefRegistrySyncable;
}

namespace extensions {

// Converts a ZoomMode to its ZoomSettings representation.
void ZoomModeToZoomSettings(zoom::ZoomController::ZoomMode zoom_mode,
                            api::tabs::ZoomSettings* zoom_settings);

// Windows
class WindowsGetFunction : public ExtensionFunction {};
class WindowsGetCurrentFunction : public ExtensionFunction {};
class WindowsGetLastFocusedFunction : public ExtensionFunction {};
class WindowsGetAllFunction : public ExtensionFunction {};
class WindowsCreateFunction : public ExtensionFunction {};
class WindowsUpdateFunction : public ExtensionFunction {};
class WindowsRemoveFunction : public ExtensionFunction {};

// Tabs
class TabsGetFunction : public ExtensionFunction {};
class TabsGetCurrentFunction : public ExtensionFunction {};
class TabsGetSelectedFunction : public ExtensionFunction {};
class TabsGetAllInWindowFunction : public ExtensionFunction {};
class TabsQueryFunction : public ExtensionFunction {};
class TabsCreateFunction : public ExtensionFunction {};
class TabsDuplicateFunction : public ExtensionFunction {};
class TabsHighlightFunction : public ExtensionFunction {};
class TabsUpdateFunction : public ExtensionFunction {};
class TabsMoveFunction : public ExtensionFunction {};
class TabsReloadFunction : public ExtensionFunction {};
class TabsRemoveFunction : public ExtensionFunction {};
class TabsGroupFunction : public ExtensionFunction {};
class TabsUngroupFunction : public ExtensionFunction {};
class TabsDetectLanguageFunction
    : public ExtensionFunction,
      public content::WebContentsObserver,
      public translate::TranslateDriver::LanguageDetectionObserver {};

class TabsCaptureVisibleTabFunction
    : public extensions::WebContentsCaptureClient,
      public ExtensionFunction {};

// Implement API calls tabs.executeScript, tabs.insertCSS, and tabs.removeCSS.
class ExecuteCodeInTabFunction : public ExecuteCodeFunction {};

class TabsExecuteScriptFunction : public ExecuteCodeInTabFunction {};

class TabsInsertCSSFunction : public ExecuteCodeInTabFunction {};

// TODO(https://crrev.com/c/608854): When a file URL is passed, this will do
// more work than needed: since the key is created based on the file URL in
// that case, we don't actually need to
//
// a) load the file or
// b) localize it
//
// ... hence, it could just go straight to the ScriptExecutor.
class TabsRemoveCSSFunction : public ExecuteCodeInTabFunction {};

class TabsSetZoomFunction : public ExtensionFunction {};

class TabsGetZoomFunction : public ExtensionFunction {};

class TabsSetZoomSettingsFunction : public ExtensionFunction {};

class TabsGetZoomSettingsFunction : public ExtensionFunction {};

class TabsDiscardFunction : public ExtensionFunction {};

class TabsGoForwardFunction : public ExtensionFunction {};

class TabsGoBackFunction : public ExtensionFunction {};

}  // namespace extensions

#endif  // CHROME_BROWSER_EXTENSIONS_API_TABS_TABS_API_H_