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

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

Issue 7748026: content: Reapply "Start splitting up chrome/browser/ui/gtk/gtk_util.h" (r98287) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on Monday. Created 9 years, 3 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"
16 #include "ui/base/l10n/l10n_util.h" 17 #include "ui/base/l10n/l10n_util.h"
17 18
18 namespace importer { 19 namespace importer {
19 20
20 void ShowImportLockDialog(gfx::NativeWindow parent, 21 void ShowImportLockDialog(gfx::NativeWindow parent,
21 ImporterHost* importer_host) { 22 ImporterHost* importer_host) {
22 ImportLockDialogGtk::Show(parent, importer_host); 23 ImportLockDialogGtk::Show(parent, importer_host);
23 UserMetrics::RecordAction(UserMetricsAction("ImportLockDialogGtk_Shown")); 24 UserMetrics::RecordAction(UserMetricsAction("ImportLockDialogGtk_Shown"));
24 } 25 }
25 26
(...skipping 15 matching lines...) Expand all
41 NULL); 42 NULL);
42 43
43 gtk_util::AddButtonToDialog(dialog_, 44 gtk_util::AddButtonToDialog(dialog_,
44 l10n_util::GetStringUTF8(IDS_IMPORTER_LOCK_CANCEL).c_str(), 45 l10n_util::GetStringUTF8(IDS_IMPORTER_LOCK_CANCEL).c_str(),
45 GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT); 46 GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT);
46 gtk_util::AddButtonToDialog(dialog_, 47 gtk_util::AddButtonToDialog(dialog_,
47 l10n_util::GetStringUTF8(IDS_IMPORTER_LOCK_OK).c_str(), 48 l10n_util::GetStringUTF8(IDS_IMPORTER_LOCK_OK).c_str(),
48 GTK_STOCK_OK, GTK_RESPONSE_ACCEPT); 49 GTK_STOCK_OK, GTK_RESPONSE_ACCEPT);
49 50
50 GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_)); 51 GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_));
51 gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); 52 gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing);
52 GtkWidget* label = gtk_label_new( 53 GtkWidget* label = gtk_label_new(
53 l10n_util::GetStringUTF8(IDS_IMPORTER_LOCK_TEXT).c_str()); 54 l10n_util::GetStringUTF8(IDS_IMPORTER_LOCK_TEXT).c_str());
54 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); 55 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
55 gtk_box_pack_start(GTK_BOX(content_area), label, FALSE, FALSE, 0); 56 gtk_box_pack_start(GTK_BOX(content_area), label, FALSE, FALSE, 0);
56 57
57 g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); 58 g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this);
58 gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE); 59 gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE);
59 gtk_widget_show_all(dialog_); 60 gtk_widget_show_all(dialog_);
60 } 61 }
61 62
62 ImportLockDialogGtk::~ImportLockDialogGtk() {} 63 ImportLockDialogGtk::~ImportLockDialogGtk() {}
63 64
64 void ImportLockDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { 65 void ImportLockDialogGtk::OnResponse(GtkWidget* dialog, int response_id) {
65 if (response_id == GTK_RESPONSE_ACCEPT) { 66 if (response_id == GTK_RESPONSE_ACCEPT) {
66 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( 67 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
67 importer_host_.get(), &ImporterHost::OnImportLockDialogEnd, true)); 68 importer_host_.get(), &ImporterHost::OnImportLockDialogEnd, true));
68 } else { 69 } else {
69 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( 70 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
70 importer_host_.get(), &ImporterHost::OnImportLockDialogEnd, false)); 71 importer_host_.get(), &ImporterHost::OnImportLockDialogEnd, false));
71 } 72 }
72 gtk_widget_destroy(dialog_); 73 gtk_widget_destroy(dialog_);
73 delete this; 74 delete this;
74 } 75 }
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