OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/gtk/options/general_page_gtk.h" | 5 #include "chrome/browser/gtk/options/general_page_gtk.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 } | 592 } |
593 | 593 |
594 pref.urls = startup_custom_pages_table_model_->GetURLs(); | 594 pref.urls = startup_custom_pages_table_model_->GetURLs(); |
595 | 595 |
596 SessionStartupPref::SetStartupPref(profile()->GetPrefs(), pref); | 596 SessionStartupPref::SetStartupPref(profile()->GetPrefs(), pref); |
597 } | 597 } |
598 | 598 |
599 void GeneralPageGtk::SetColumnValues(int row, GtkTreeIter* iter) { | 599 void GeneralPageGtk::SetColumnValues(int row, GtkTreeIter* iter) { |
600 SkBitmap bitmap = startup_custom_pages_table_model_->GetIcon(row); | 600 SkBitmap bitmap = startup_custom_pages_table_model_->GetIcon(row); |
601 GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(&bitmap); | 601 GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(&bitmap); |
602 std::wstring text = startup_custom_pages_table_model_->GetText(row, 0); | 602 string16 text = startup_custom_pages_table_model_->GetText(row, 0); |
603 std::string tooltip = | 603 std::string tooltip = |
604 WideToUTF8(startup_custom_pages_table_model_->GetTooltip(row)); | 604 UTF16ToUTF8(startup_custom_pages_table_model_->GetTooltip(row)); |
605 gchar* escaped_tooltip = g_markup_escape_text(tooltip.c_str(), | 605 gchar* escaped_tooltip = g_markup_escape_text(tooltip.c_str(), |
606 tooltip.size()); | 606 tooltip.size()); |
607 gtk_list_store_set(startup_custom_pages_store_, iter, | 607 gtk_list_store_set(startup_custom_pages_store_, iter, |
608 COL_FAVICON, pixbuf, | 608 COL_FAVICON, pixbuf, |
609 COL_URL, WideToUTF8(text).c_str(), | 609 COL_URL, UTF16ToUTF8(text).c_str(), |
610 COL_TOOLTIP, escaped_tooltip, | 610 COL_TOOLTIP, escaped_tooltip, |
611 -1); | 611 -1); |
612 g_object_unref(pixbuf); | 612 g_object_unref(pixbuf); |
613 g_free(escaped_tooltip); | 613 g_free(escaped_tooltip); |
614 } | 614 } |
615 | 615 |
616 void GeneralPageGtk::SetCustomUrlListFromCurrentPages() { | 616 void GeneralPageGtk::SetCustomUrlListFromCurrentPages() { |
617 startup_custom_pages_table_model_->SetToCurrentlyOpenPages(); | 617 startup_custom_pages_table_model_->SetToCurrentlyOpenPages(); |
618 | 618 |
619 SaveStartupPref(); | 619 SaveStartupPref(); |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 int desired_width = allocation->x - sender->parent->allocation.x; | 797 int desired_width = allocation->x - sender->parent->allocation.x; |
798 GtkRequisition req; | 798 GtkRequisition req; |
799 gtk_widget_size_request(instant_indent_, &req); | 799 gtk_widget_size_request(instant_indent_, &req); |
800 if (req.width != desired_width) | 800 if (req.width != desired_width) |
801 gtk_widget_set_size_request(instant_indent_, desired_width, -1); | 801 gtk_widget_set_size_request(instant_indent_, desired_width, -1); |
802 } | 802 } |
803 | 803 |
804 void GeneralPageGtk::OnSearchLearnMoreClicked(GtkWidget* sender) { | 804 void GeneralPageGtk::OnSearchLearnMoreClicked(GtkWidget* sender) { |
805 browser::ShowOptionsURL(profile(), browser::InstantLearnMoreURL()); | 805 browser::ShowOptionsURL(profile(), browser::InstantLearnMoreURL()); |
806 } | 806 } |
OLD | NEW |