OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "chrome/browser/browser.h" | 8 #include "chrome/browser/browser.h" |
9 #include "chrome/browser/browser_list.h" | 9 #include "chrome/browser/browser_list.h" |
10 #include "chrome/browser/gtk/keyword_editor_view.h" | 10 #include "chrome/browser/gtk/keyword_editor_view.h" |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 enable && | 686 enable && |
687 gtk_tree_selection_count_selected_rows(startup_custom_pages_selection_)); | 687 gtk_tree_selection_count_selected_rows(startup_custom_pages_selection_)); |
688 gtk_widget_set_sensitive(startup_use_current_page_button_, enable); | 688 gtk_widget_set_sensitive(startup_use_current_page_button_, enable); |
689 gtk_widget_set_sensitive(startup_custom_pages_tree_, enable); | 689 gtk_widget_set_sensitive(startup_custom_pages_tree_, enable); |
690 } | 690 } |
691 | 691 |
692 void GeneralPageGtk::SetDefaultBrowserUIState( | 692 void GeneralPageGtk::SetDefaultBrowserUIState( |
693 ShellIntegration::DefaultBrowserUIState state) { | 693 ShellIntegration::DefaultBrowserUIState state) { |
694 const char* color = NULL; | 694 const char* color = NULL; |
695 std::string text; | 695 std::string text; |
696 if (state == ShellIntegration::STATE_DEFAULT) { | 696 if (state == ShellIntegration::STATE_IS_DEFAULT) { |
697 color = kDefaultBrowserLabelColor; | 697 color = kDefaultBrowserLabelColor; |
698 text = l10n_util::GetStringFUTF8(IDS_OPTIONS_DEFAULTBROWSER_DEFAULT, | 698 text = l10n_util::GetStringFUTF8(IDS_OPTIONS_DEFAULTBROWSER_DEFAULT, |
699 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 699 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
700 } else if (state == ShellIntegration::STATE_NOT_DEFAULT) { | 700 } else if (state == ShellIntegration::STATE_NOT_DEFAULT) { |
701 color = kNotDefaultBrowserLabelColor; | 701 color = kNotDefaultBrowserLabelColor; |
702 text = l10n_util::GetStringFUTF8(IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT, | 702 text = l10n_util::GetStringFUTF8(IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT, |
703 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 703 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
| 704 } else if (state == ShellIntegration::STATE_UNKNOWN) { |
| 705 color = kNotDefaultBrowserLabelColor; |
| 706 text = l10n_util::GetStringFUTF8(IDS_OPTIONS_DEFAULTBROWSER_UNKNOWN, |
| 707 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
704 } | 708 } |
705 if (color) { | 709 if (color) { |
706 char* markup = g_markup_printf_escaped(kDefaultBrowserLabelMarkup, | 710 char* markup = g_markup_printf_escaped(kDefaultBrowserLabelMarkup, |
707 color, text.c_str()); | 711 color, text.c_str()); |
708 gtk_label_set_markup(GTK_LABEL(default_browser_status_label_), markup); | 712 gtk_label_set_markup(GTK_LABEL(default_browser_status_label_), markup); |
709 g_free(markup); | 713 g_free(markup); |
710 } | 714 } |
711 | 715 |
712 gtk_widget_set_sensitive(default_browser_use_as_default_button_, | 716 gtk_widget_set_sensitive(default_browser_use_as_default_button_, |
713 state == ShellIntegration::STATE_NOT_DEFAULT); | 717 state == ShellIntegration::STATE_NOT_DEFAULT); |
714 } | 718 } |
OLD | NEW |