| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.h" | 5 #include "chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| 11 #include "chrome/browser/importer/importer_host.h" | 11 #include "chrome/browser/importer/importer_host.h" |
| 12 #include "chrome/browser/importer/importer_lock_dialog.h" | 12 #include "chrome/browser/importer/importer_lock_dialog.h" |
| 13 #include "chrome/browser/ui/gtk/gtk_util.h" | 13 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 14 #include "content/browser/user_metrics.h" | 14 #include "content/public/browser/user_metrics.h" |
| 15 #include "grit/chromium_strings.h" | 15 #include "grit/chromium_strings.h" |
| 16 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
| 17 #include "ui/base/gtk/gtk_hig_constants.h" | 17 #include "ui/base/gtk/gtk_hig_constants.h" |
| 18 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
| 19 | 19 |
| 20 using content::UserMetricsAction; |
| 21 |
| 20 namespace importer { | 22 namespace importer { |
| 21 | 23 |
| 22 void ShowImportLockDialog(gfx::NativeWindow parent, | 24 void ShowImportLockDialog(gfx::NativeWindow parent, |
| 23 ImporterHost* importer_host) { | 25 ImporterHost* importer_host) { |
| 24 ImportLockDialogGtk::Show(parent, importer_host); | 26 ImportLockDialogGtk::Show(parent, importer_host); |
| 25 UserMetrics::RecordAction(UserMetricsAction("ImportLockDialogGtk_Shown")); | 27 content::RecordAction(UserMetricsAction("ImportLockDialogGtk_Shown")); |
| 26 } | 28 } |
| 27 | 29 |
| 28 } // namespace importer | 30 } // namespace importer |
| 29 | 31 |
| 30 // static | 32 // static |
| 31 void ImportLockDialogGtk::Show(GtkWindow* parent, ImporterHost* importer_host) { | 33 void ImportLockDialogGtk::Show(GtkWindow* parent, ImporterHost* importer_host) { |
| 32 new ImportLockDialogGtk(parent, importer_host); | 34 new ImportLockDialogGtk(parent, importer_host); |
| 33 } | 35 } |
| 34 | 36 |
| 35 ImportLockDialogGtk::ImportLockDialogGtk(GtkWindow* parent, | 37 ImportLockDialogGtk::ImportLockDialogGtk(GtkWindow* parent, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 66 void ImportLockDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { | 68 void ImportLockDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { |
| 67 bool is_continue = response_id == GTK_RESPONSE_ACCEPT; | 69 bool is_continue = response_id == GTK_RESPONSE_ACCEPT; |
| 68 MessageLoop::current()->PostTask(FROM_HERE, | 70 MessageLoop::current()->PostTask(FROM_HERE, |
| 69 base::Bind(&ImporterHost::OnImportLockDialogEnd, | 71 base::Bind(&ImporterHost::OnImportLockDialogEnd, |
| 70 importer_host_.get(), | 72 importer_host_.get(), |
| 71 is_continue)); | 73 is_continue)); |
| 72 | 74 |
| 73 gtk_widget_destroy(dialog_); | 75 gtk_widget_destroy(dialog_); |
| 74 delete this; | 76 delete this; |
| 75 } | 77 } |
| OLD | NEW |