chromium/extensions/browser/api/app_window/app_window_api.cc

// 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.

#include "extensions/browser/api/app_window/app_window_api.h"

#include <memory>
#include <utility>

#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/time/time.h"
#include "base/types/optional_util.h"
#include "base/values.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/color_parser.h"
#include "content/public/common/url_constants.h"
#include "extensions/browser/app_window/app_window.h"
#include "extensions/browser/app_window/app_window_client.h"
#include "extensions/browser/app_window/app_window_contents.h"
#include "extensions/browser/app_window/app_window_registry.h"
#include "extensions/browser/app_window/native_app_window.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/common/api/app_runtime.h"
#include "extensions/common/api/app_window.h"
#include "extensions/common/features/simple_feature.h"
#include "extensions/common/image_util.h"
#include "extensions/common/manifest.h"
#include "extensions/common/mojom/context_type.mojom.h"
#include "extensions/common/permissions/permissions_data.h"
#include "extensions/common/switches.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/ui_base_types.h"
#include "ui/gfx/geometry/rect.h"
#include "url/gurl.h"

app_window;
Create;

namespace extensions {

namespace app_window_constants {
constexpr char kInvalidWindowId[] =;
constexpr char kInvalidColorSpecification[] =;
constexpr char kColorWithFrameNone[] =;
constexpr char kInactiveColorWithoutColor[] =;
constexpr char kConflictingBoundsOptions[] =;
constexpr char kAlwaysOnTopPermission[] =;
constexpr char kInvalidUrlParameter[] =;
constexpr char kAlphaEnabledWrongChannel[] =;
constexpr char kAlphaEnabledMissingPermission[] =;
constexpr char kAlphaEnabledNeedsFrameNone[] =;
constexpr char kImeWindowMissingPermission[] =;
constexpr char kImeOptionIsNotSupported[] =;
#if !BUILDFLAG(IS_CHROMEOS_ASH)
constexpr char kImeWindowUnsupportedPlatform[] =;
#else
constexpr char kImeWindowMustBeImeWindow[] =
    "IME extensions must create an IME window ( with \"ime: true\" and "
    "\"frame: 'none'\"). Panels are no longer supported for IME extensions.";
#endif
constexpr char kShowInShelfWindowKeyNotSet[] =;
constexpr char kLockScreenActionRequiresLockScreenContext[] =;
constexpr char kLockScreenActionRequiresLockScreenPermission[] =;
constexpr char kAppWindowCreationFailed[] =;
constexpr char kPrematureWindowClose[] =;
}  // namespace app_window_constants

const char kNoneFrameOption[] =;

namespace {

// If the same property is specified for the inner and outer bounds, raise an
// error.
bool CheckBoundsConflict(const std::optional<int>& inner_property,
                         const std::optional<int>& outer_property,
                         const std::string& property_name,
                         std::string* error) {}

// Copy over the bounds specification properties from the API to the
// AppWindow::CreateParams.
void CopyBoundsSpec(const app_window::BoundsSpecification* input_spec,
                    AppWindow::BoundsSpecification* create_spec) {}

}  // namespace

AppWindowCreateFunction::AppWindowCreateFunction() = default;

ExtensionFunction::ResponseAction AppWindowCreateFunction::Run() {}

void AppWindowCreateFunction::OnAppWindowFinishedFirstNavigationOrClosed(
    AppWindow* app_window,
    bool is_existing_window,
    bool did_finish) {}

bool AppWindowCreateFunction::GetBoundsSpec(
    const app_window::CreateWindowOptions& options,
    AppWindow::CreateParams* params,
    std::string* error) {}

AppWindow::Frame AppWindowCreateFunction::GetFrameFromString(
    const std::string& frame_string) {}

bool AppWindowCreateFunction::GetFrameOptions(
    const app_window::CreateWindowOptions& options,
    AppWindow::CreateParams* create_params,
    std::string* error) {}

}  // namespace extensions