chromium/components/javascript_dialogs/app_modal_dialog_controller.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 "components/javascript_dialogs/app_modal_dialog_controller.h"

#include <utility>

#include "build/build_config.h"
#include "components/javascript_dialogs/app_modal_dialog_manager.h"
#include "components/javascript_dialogs/app_modal_dialog_queue.h"
#include "components/javascript_dialogs/app_modal_dialog_view.h"
#include "ui/gfx/text_elider.h"

namespace javascript_dialogs {
namespace {

AppModalDialogObserver* app_modal_dialog_observer =;

// Control maximum sizes of various texts passed to us from javascript.
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE)
// Two-dimensional eliding.  Reformat the text of the message dialog
// inserting line breaks because otherwise a single long line can overflow
// the message dialog (and crash/hang the GTK, depending on the version).
const int kMessageTextMaxRows =;
const int kMessageTextMaxCols =;
const int kDefaultPromptMaxRows =;
const int kDefaultPromptMaxCols =;

std::u16string EnforceMaxTextSize(const std::u16string& in_string) {}

std::u16string EnforceMaxPromptSize(const std::u16string& in_string) {}

#else
// One-dimensional eliding.  Trust the window system to break the string
// appropriately, but limit its overall length to something reasonable.
const size_t kMessageTextMaxSize = 2000;
const size_t kDefaultPromptMaxSize = 2000;

std::u16string EnforceMaxTextSize(const std::u16string& in_string) {
  std::u16string out_string;
  gfx::ElideString(in_string, kMessageTextMaxSize, &out_string);
  return out_string;
}

std::u16string EnforceMaxPromptSize(const std::u16string& in_string) {
  std::u16string out_string;
  gfx::ElideString(in_string, kDefaultPromptMaxSize, &out_string);
  return out_string;
}
#endif

}  // namespace

ChromeJavaScriptDialogExtraData::ChromeJavaScriptDialogExtraData()
    :{}

AppModalDialogController::AppModalDialogController(
    content::WebContents* web_contents,
    ExtraDataMap* extra_data_map,
    const std::u16string& title,
    content::JavaScriptDialogType javascript_dialog_type,
    const std::u16string& message_text,
    const std::u16string& default_prompt_text,
    bool display_suppress_checkbox,
    bool is_before_unload_dialog,
    bool is_reload,
    content::JavaScriptDialogManager::DialogClosedCallback callback)
    :{}

AppModalDialogController::~AppModalDialogController() {}

void AppModalDialogController::ShowModalDialog() {}

void AppModalDialogController::ActivateModalDialog() {}

void AppModalDialogController::CloseModalDialog() {}

void AppModalDialogController::CompleteDialog() {}

bool AppModalDialogController::IsValid() {}

void AppModalDialogController::Invalidate() {}

void AppModalDialogController::OnCancel(bool suppress_js_messages) {}

void AppModalDialogController::OnAccept(const std::u16string& prompt_text,
                                        bool suppress_js_messages) {}

void AppModalDialogController::OnClose() {}

void AppModalDialogController::SetOverridePromptText(
    const std::u16string& override_prompt_text) {}

void AppModalDialogController::NotifyDelegate(bool success,
                                              const std::u16string& user_input,
                                              bool suppress_js_messages) {}

void AppModalDialogController::CallDialogClosedCallback(
    bool success,
    const std::u16string& user_input) {}

AppModalDialogObserver::AppModalDialogObserver() {}

AppModalDialogObserver::~AppModalDialogObserver() {}

}  // namespace javascript_dialogs