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

Side by Side Diff: chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.cc

Issue 7749017: Revert "content: Start splitting up chrome/browser/ui/gtk/gtk_util.h" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/message_loop.h" 9 #include "base/message_loop.h"
10 #include "chrome/browser/importer/importer_host.h" 10 #include "chrome/browser/importer/importer_host.h"
11 #include "chrome/browser/importer/importer_lock_dialog.h" 11 #include "chrome/browser/importer/importer_lock_dialog.h"
12 #include "chrome/browser/ui/gtk/gtk_util.h" 12 #include "chrome/browser/ui/gtk/gtk_util.h"
13 #include "content/browser/user_metrics.h" 13 #include "content/browser/user_metrics.h"
14 #include "grit/chromium_strings.h" 14 #include "grit/chromium_strings.h"
15 #include "grit/generated_resources.h" 15 #include "grit/generated_resources.h"
16 #include "ui/base/gtk/gtk_hig_constants.h"
17 #include "ui/base/l10n/l10n_util.h" 16 #include "ui/base/l10n/l10n_util.h"
18 17
19 namespace importer { 18 namespace importer {
20 19
21 void ShowImportLockDialog(gfx::NativeWindow parent, 20 void ShowImportLockDialog(gfx::NativeWindow parent,
22 ImporterHost* importer_host) { 21 ImporterHost* importer_host) {
23 ImportLockDialogGtk::Show(parent, importer_host); 22 ImportLockDialogGtk::Show(parent, importer_host);
24 UserMetrics::RecordAction(UserMetricsAction("ImportLockDialogGtk_Shown")); 23 UserMetrics::RecordAction(UserMetricsAction("ImportLockDialogGtk_Shown"));
25 } 24 }
26 25
(...skipping 15 matching lines...) Expand all
42 NULL); 41 NULL);
43 42
44 gtk_util::AddButtonToDialog(dialog_, 43 gtk_util::AddButtonToDialog(dialog_,
45 l10n_util::GetStringUTF8(IDS_IMPORTER_LOCK_CANCEL).c_str(), 44 l10n_util::GetStringUTF8(IDS_IMPORTER_LOCK_CANCEL).c_str(),
46 GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT); 45 GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT);
47 gtk_util::AddButtonToDialog(dialog_, 46 gtk_util::AddButtonToDialog(dialog_,
48 l10n_util::GetStringUTF8(IDS_IMPORTER_LOCK_OK).c_str(), 47 l10n_util::GetStringUTF8(IDS_IMPORTER_LOCK_OK).c_str(),
49 GTK_STOCK_OK, GTK_RESPONSE_ACCEPT); 48 GTK_STOCK_OK, GTK_RESPONSE_ACCEPT);
50 49
51 GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_)); 50 GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_));
52 gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); 51 gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing);
53 GtkWidget* label = gtk_label_new( 52 GtkWidget* label = gtk_label_new(
54 l10n_util::GetStringUTF8(IDS_IMPORTER_LOCK_TEXT).c_str()); 53 l10n_util::GetStringUTF8(IDS_IMPORTER_LOCK_TEXT).c_str());
55 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); 54 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
56 gtk_box_pack_start(GTK_BOX(content_area), label, FALSE, FALSE, 0); 55 gtk_box_pack_start(GTK_BOX(content_area), label, FALSE, FALSE, 0);
57 56
58 g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); 57 g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this);
59 gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE); 58 gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE);
60 gtk_widget_show_all(dialog_); 59 gtk_widget_show_all(dialog_);
61 } 60 }
62 61
63 ImportLockDialogGtk::~ImportLockDialogGtk() {} 62 ImportLockDialogGtk::~ImportLockDialogGtk() {}
64 63
65 void ImportLockDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { 64 void ImportLockDialogGtk::OnResponse(GtkWidget* dialog, int response_id) {
66 if (response_id == GTK_RESPONSE_ACCEPT) { 65 if (response_id == GTK_RESPONSE_ACCEPT) {
67 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( 66 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
68 importer_host_.get(), &ImporterHost::OnImportLockDialogEnd, true)); 67 importer_host_.get(), &ImporterHost::OnImportLockDialogEnd, true));
69 } else { 68 } else {
70 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( 69 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
71 importer_host_.get(), &ImporterHost::OnImportLockDialogEnd, false)); 70 importer_host_.get(), &ImporterHost::OnImportLockDialogEnd, false));
72 } 71 }
73 gtk_widget_destroy(dialog_); 72 gtk_widget_destroy(dialog_);
74 delete this; 73 delete this;
75 } 74 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc ('k') | chrome/browser/ui/gtk/importer/import_progress_dialog_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698