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

Unified Diff: chrome/browser/gtk/import_lock_dialog_gtk.cc

Issue 114047: Add import progress indicator dialog. (Closed)
Patch Set: code review fixes Created 11 years, 7 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
« no previous file with comments | « chrome/browser/gtk/import_lock_dialog_gtk.h ('k') | chrome/browser/gtk/import_progress_dialog_gtk.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/import_lock_dialog_gtk.cc
diff --git a/chrome/browser/gtk/import_lock_dialog_gtk.cc b/chrome/browser/gtk/import_lock_dialog_gtk.cc
new file mode 100644
index 0000000000000000000000000000000000000000..179df9ff57af10924bd3f40d58afff3aae5efb73
--- /dev/null
+++ b/chrome/browser/gtk/import_lock_dialog_gtk.cc
@@ -0,0 +1,53 @@
+// Copyright (c) 2009 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/gtk/import_lock_dialog_gtk.h"
+
+#include "app/l10n_util.h"
+#include "app/resource_bundle.h"
+#include "grit/generated_resources.h"
+#include "grit/chromium_strings.h"
+
+// static
+void ImportLockDialogGtk::Show(GtkWindow* parent, ImporterHost* importer_host) {
+ new ImportLockDialogGtk(parent, importer_host);
+}
+
+ImportLockDialogGtk::ImportLockDialogGtk(GtkWindow* parent,
+ ImporterHost* importer_host) : importer_host_(importer_host) {
+ // Build the dialog.
+ dialog_ = gtk_dialog_new_with_buttons(
+ l10n_util::GetStringUTF8(IDS_IMPORTER_LOCK_TITLE).c_str(),
+ parent,
+ (GtkDialogFlags) (GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR),
+ GTK_STOCK_OK,
+ GTK_RESPONSE_ACCEPT,
+ GTK_STOCK_CANCEL,
+ GTK_RESPONSE_REJECT,
+ NULL);
+
+ GtkWidget* content_area = GTK_DIALOG(dialog_)->vbox;
+ gtk_box_set_spacing(GTK_BOX(content_area), 18);
+ GtkWidget* label = gtk_label_new(
+ l10n_util::GetStringUTF8(IDS_IMPORTER_LOCK_TEXT).c_str());
+ gtk_label_set_single_line_mode(GTK_LABEL(label), FALSE);
+ gtk_box_pack_start(GTK_BOX(content_area), label, FALSE, FALSE, 0);
+
+ g_signal_connect(dialog_, "response",
+ G_CALLBACK(HandleOnResponseDialog), this);
+ gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE);
+ gtk_widget_show_all(dialog_);
+}
+
+void ImportLockDialogGtk::OnDialogResponse(GtkWidget* widget, int response) {
+ if (response == GTK_RESPONSE_ACCEPT) {
+ MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
+ importer_host_.get(), &ImporterHost::OnLockViewEnd, true));
+ } else {
+ MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
+ importer_host_.get(), &ImporterHost::OnLockViewEnd, false));
+ }
+ gtk_widget_destroy(dialog_);
+ delete this;
+}
« no previous file with comments | « chrome/browser/gtk/import_lock_dialog_gtk.h ('k') | chrome/browser/gtk/import_progress_dialog_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698