<commit_before>// Copyright (c) 2011 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 "remoting/host/disconnect_window.h"

#include <gtk/gtk.h>

#include "base/compiler_specific.h"
#include "base/logging.h"
#include "remoting/host/chromoting_host.h"
#include "ui/base/gtk/gtk_signal.h"

namespace {

const char kDisconnectWindowTitle[] = "Remoting";
const char kDisconnectWindowShareText[] = "Sharing with: ";
const char kDisconnectWindowButtonText[] = "Disconnect";

class DisconnectWindowLinux : public remoting::DisconnectWindow {
 public:
  DisconnectWindowLinux();

  virtual void Show(remoting::ChromotingHost* host,
                    const std::string& username) OVERRIDE;
  virtual void Hide() OVERRIDE;

 private:
  CHROMEGTK_CALLBACK_1(DisconnectWindowLinux, gboolean, OnWindowDelete,
                       GdkEvent*);
  CHROMEG_CALLBACK_0(DisconnectWindowLinux, void, OnDisconnectClicked,
                     GtkButton*);

  void CreateWindow();

  remoting::ChromotingHost* host_;
  GtkWidget* disconnect_window_;
  GtkWidget* user_label_;

  DISALLOW_COPY_AND_ASSIGN(DisconnectWindowLinux);
};
}  // namespace

DisconnectWindowLinux::DisconnectWindowLinux()
    : host_(NULL),
      disconnect_window_(NULL) {
}

void DisconnectWindowLinux::CreateWindow() {
  if (disconnect_window_) return;

  disconnect_window_ = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  GtkWindow* window = GTK_WINDOW(disconnect_window_);
  gtk_window_set_title(window, kDisconnectWindowTitle);
  gtk_window_set_resizable(window, FALSE);
  // Try to keep the window always visible.
  gtk_window_stick(window);
  gtk_window_set_keep_above(window, TRUE);

  g_signal_connect(disconnect_window_, "delete-event",<commit_msg>Remove minimize/close buttons from DisconnectWindowLinux.<commit_after>// Copyright (c) 2011 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 "remoting/host/disconnect_window.h"

#include <gtk/gtk.h>

#include "base/compiler_specific.h"
#include "base/logging.h"
#include "remoting/host/chromoting_host.h"
#include "ui/base/gtk/gtk_signal.h"

namespace {

const char kDisconnectWindowTitle[] = "Remoting";
const char kDisconnectWindowShareText[] = "Sharing with: ";
const char kDisconnectWindowButtonText[] = "Disconnect";

class DisconnectWindowLinux : public remoting::DisconnectWindow {
 public:
  DisconnectWindowLinux();

  virtual void Show(remoting::ChromotingHost* host,
                    const std::string& username) OVERRIDE;
  virtual void Hide() OVERRIDE;

 private:
  CHROMEGTK_CALLBACK_1(DisconnectWindowLinux, gboolean, OnWindowDelete,
                       GdkEvent*);
  CHROMEG_CALLBACK_0(DisconnectWindowLinux, void, OnDisconnectClicked,
                     GtkButton*);

  void CreateWindow();

  remoting::ChromotingHost* host_;
  GtkWidget* disconnect_window_;
  GtkWidget* user_label_;

  DISALLOW_COPY_AND_ASSIGN(DisconnectWindowLinux);
};
}  // namespace

DisconnectWindowLinux::DisconnectWindowLinux()
    : host_(NULL),
      disconnect_window_(NULL) {
}

void DisconnectWindowLinux::CreateWindow() {
  if (disconnect_window_) return;

  disconnect_window_ = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  GtkWindow* window = GTK_WINDOW(disconnect_window_);
  gtk_window_set_title(window, kDisconnectWindowTitle);
  gtk_window_set_resizable(window, FALSE);
  // Try to keep the window always visible.
  gtk_window_stick(window);
  gtk_window_set_keep_above(window, TRUE);
  // Utility windows have no minimize button or taskbar presence.
  gtk_window_set_type_hint(window, GDK_WINDOW_TYPE_HINT_UTILITY);
  gtk_window_set_deletable(window, FALSE);

  g_signal_connect(disconnect_window_, "delete-event",
{'fraction_non_alphanumeric': 0.09544863459037711, 'fraction_numerical': 0.0031209362808842654, 'mean_word_length': 5.0854430379746836, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3092974', 'n_tokens_mistral': 1274, 'n_tokens_neox': 1193, 'n_words': 258}