Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5462)

Unified Diff: chrome/browser/ui/gtk/process_singleton_dialog.cc

Issue 231733005: Delete the GTK+ port of Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remerge to ToT Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/gtk/process_singleton_dialog.cc
diff --git a/chrome/browser/ui/gtk/process_singleton_dialog.cc b/chrome/browser/ui/gtk/process_singleton_dialog.cc
deleted file mode 100644
index fe784c0611a27079a35858e0e445ee05f5646de9..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/gtk/process_singleton_dialog.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-// 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 "chrome/browser/ui/process_singleton_dialog_linux.h"
-
-#include <gtk/gtk.h>
-
-#include <string>
-
-#include "base/basictypes.h"
-#include "base/message_loop/message_loop.h"
-#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/ui/gtk/gtk_util.h"
-#include "grit/chromium_strings.h"
-#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/l10n/l10n_util.h"
-
-namespace {
-
-class ProcessSingletonDialog {
- public:
- ProcessSingletonDialog(const std::string& message,
- const std::string& relaunch_text);
-
- int GetResponseId() const { return response_id_; }
-
- private:
- CHROMEGTK_CALLBACK_1(ProcessSingletonDialog, void, OnResponse, int);
-
- GtkWidget* dialog_;
- int response_id_;
-
- DISALLOW_COPY_AND_ASSIGN(ProcessSingletonDialog);
-};
-
-ProcessSingletonDialog::ProcessSingletonDialog(
- const std::string& message,
- const std::string& relaunch_text) {
- dialog_ = gtk_message_dialog_new(
- NULL,
- static_cast<GtkDialogFlags>(0),
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_NONE,
- "%s",
- message.c_str());
- gtk_util::ApplyMessageDialogQuirks(dialog_);
- gtk_window_set_title(GTK_WINDOW(dialog_),
- l10n_util::GetStringUTF8(IDS_PRODUCT_NAME).c_str());
- gtk_dialog_add_button(GTK_DIALOG(dialog_), GTK_STOCK_QUIT,
- GTK_RESPONSE_REJECT);
- gtk_dialog_add_button(GTK_DIALOG(dialog_), relaunch_text.c_str(),
- GTK_RESPONSE_ACCEPT);
- gtk_dialog_set_default_response(GTK_DIALOG(dialog_), GTK_RESPONSE_ACCEPT);
-
- g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this);
-
- gtk_widget_show_all(dialog_);
- base::MessageLoop::current()->Run();
-}
-
-void ProcessSingletonDialog::OnResponse(GtkWidget* dialog, int response_id) {
- response_id_ = response_id;
- gtk_widget_destroy(dialog_);
- base::MessageLoop::current()->Quit();
-}
-
-} // namespace
-
-bool ShowProcessSingletonDialog(const base::string16& message,
- const base::string16& relaunch_text) {
- ProcessSingletonDialog dialog(base::UTF16ToUTF8(message),
- base::UTF16ToUTF8(relaunch_text));
- return dialog.GetResponseId() == GTK_RESPONSE_ACCEPT;
-}

Powered by Google App Engine
This is Rietveld 408576698