| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/create_application_shortcuts_dialog_gtk.h" | 5 #include "chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/environment.h" | 10 #include "base/environment.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 description_label, | 154 description_label, |
| 155 IDS_CREATE_SHORTCUTS_DIALOG_WIDTH_CHARS, -1, &label_width, NULL); | 155 IDS_CREATE_SHORTCUTS_DIALOG_WIDTH_CHARS, -1, &label_width, NULL); |
| 156 label_width -= ui::kControlSpacing * 3 + | 156 label_width -= ui::kControlSpacing * 3 + |
| 157 gdk_pixbuf_get_width(favicon_pixbuf_); | 157 gdk_pixbuf_get_width(favicon_pixbuf_); |
| 158 // Enforce a minimum width, so that very large icons do not cause the label | 158 // Enforce a minimum width, so that very large icons do not cause the label |
| 159 // width to shrink to unreadable size, or become negative (which would crash). | 159 // width to shrink to unreadable size, or become negative (which would crash). |
| 160 if (label_width < kDescriptionLabelMinimumWidthPixels) | 160 if (label_width < kDescriptionLabelMinimumWidthPixels) |
| 161 label_width = kDescriptionLabelMinimumWidthPixels; | 161 label_width = kDescriptionLabelMinimumWidthPixels; |
| 162 gtk_util::SetLabelWidth(description_label, label_width); | 162 gtk_util::SetLabelWidth(description_label, label_width); |
| 163 | 163 |
| 164 std::string description(UTF16ToUTF8(shortcut_info_.description)); | 164 std::string description(base::UTF16ToUTF8(shortcut_info_.description)); |
| 165 std::string title(UTF16ToUTF8(shortcut_info_.title)); | 165 std::string title(base::UTF16ToUTF8(shortcut_info_.title)); |
| 166 gtk_label_set_text(GTK_LABEL(description_label), | 166 gtk_label_set_text(GTK_LABEL(description_label), |
| 167 (description.empty() ? title : description).c_str()); | 167 (description.empty() ? title : description).c_str()); |
| 168 | 168 |
| 169 // Label on top of the checkboxes. | 169 // Label on top of the checkboxes. |
| 170 GtkWidget* checkboxes_label = gtk_label_new( | 170 GtkWidget* checkboxes_label = gtk_label_new( |
| 171 l10n_util::GetStringUTF8(IDS_CREATE_SHORTCUTS_LABEL).c_str()); | 171 l10n_util::GetStringUTF8(IDS_CREATE_SHORTCUTS_LABEL).c_str()); |
| 172 gtk_misc_set_alignment(GTK_MISC(checkboxes_label), 0, 0); | 172 gtk_misc_set_alignment(GTK_MISC(checkboxes_label), 0, 0); |
| 173 gtk_box_pack_start(GTK_BOX(vbox), checkboxes_label, FALSE, FALSE, 0); | 173 gtk_box_pack_start(GTK_BOX(vbox), checkboxes_label, FALSE, FALSE, 0); |
| 174 | 174 |
| 175 // Desktop checkbox. | 175 // Desktop checkbox. |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 if (web_app::CreateShortcutsOnFileThread( | 360 if (web_app::CreateShortcutsOnFileThread( |
| 361 shortcut_info, creation_locations, | 361 shortcut_info, creation_locations, |
| 362 web_app::SHORTCUT_CREATION_BY_USER)) { | 362 web_app::SHORTCUT_CREATION_BY_USER)) { |
| 363 Release(); | 363 Release(); |
| 364 } else { | 364 } else { |
| 365 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 365 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| 366 base::Bind(&CreateChromeApplicationShortcutsDialogGtk::ShowErrorDialog, | 366 base::Bind(&CreateChromeApplicationShortcutsDialogGtk::ShowErrorDialog, |
| 367 this)); | 367 this)); |
| 368 } | 368 } |
| 369 } | 369 } |
| OLD | NEW |