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

Side by Side Diff: chrome/browser/views/options/general_page_view.cc

Issue 200025: Allow the default browser check to return "unknown" and reflect that in the UI. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/views/options/general_page_view.h" 5 #include "chrome/browser/views/options/general_page_view.h"
6 6
7 #include "app/combobox_model.h" 7 #include "app/combobox_model.h"
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "app/resource_bundle.h" 9 #include "app/resource_bundle.h"
10 #include "base/gfx/png_decoder.h" 10 #include "base/gfx/png_decoder.h"
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 View::Layout(); 639 View::Layout();
640 } 640 }
641 641
642 /////////////////////////////////////////////////////////////////////////////// 642 ///////////////////////////////////////////////////////////////////////////////
643 // GeneralPageView, private: 643 // GeneralPageView, private:
644 644
645 void GeneralPageView::SetDefaultBrowserUIState( 645 void GeneralPageView::SetDefaultBrowserUIState(
646 ShellIntegration::DefaultBrowserUIState state) { 646 ShellIntegration::DefaultBrowserUIState state) {
647 bool button_enabled = state == ShellIntegration::STATE_NOT_DEFAULT; 647 bool button_enabled = state == ShellIntegration::STATE_NOT_DEFAULT;
648 default_browser_use_as_default_button_->SetEnabled(button_enabled); 648 default_browser_use_as_default_button_->SetEnabled(button_enabled);
649 if (state == ShellIntegration::STATE_DEFAULT) { 649 if (state == ShellIntegration::STATE_IS_DEFAULT) {
650 default_browser_status_label_->SetText( 650 default_browser_status_label_->SetText(
651 l10n_util::GetStringF(IDS_OPTIONS_DEFAULTBROWSER_DEFAULT, 651 l10n_util::GetStringF(IDS_OPTIONS_DEFAULTBROWSER_DEFAULT,
652 l10n_util::GetString(IDS_PRODUCT_NAME))); 652 l10n_util::GetString(IDS_PRODUCT_NAME)));
653 default_browser_status_label_->SetColor(kDefaultBrowserLabelColor); 653 default_browser_status_label_->SetColor(kDefaultBrowserLabelColor);
654 Layout(); 654 Layout();
655 } else if (state == ShellIntegration::STATE_NOT_DEFAULT) { 655 } else if (state == ShellIntegration::STATE_NOT_DEFAULT) {
656 default_browser_status_label_->SetText( 656 default_browser_status_label_->SetText(
657 l10n_util::GetStringF(IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT, 657 l10n_util::GetStringF(IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT,
658 l10n_util::GetString(IDS_PRODUCT_NAME))); 658 l10n_util::GetString(IDS_PRODUCT_NAME)));
659 default_browser_status_label_->SetColor(kNotDefaultBrowserLabelColor); 659 default_browser_status_label_->SetColor(kNotDefaultBrowserLabelColor);
660 Layout(); 660 Layout();
661 } else if (state == ShellIntegration::STATE_UNKNOWN) {
662 default_browser_status_label_->SetText(
663 l10n_util::GetStringF(IDS_OPTIONS_DEFAULTBROWSER_UNKNOWN,
664 l10n_util::GetString(IDS_PRODUCT_NAME)));
665 default_browser_status_label_->SetColor(kNotDefaultBrowserLabelColor);
666 Layout();
661 } 667 }
662 } 668 }
663 669
664 void GeneralPageView::InitStartupGroup() { 670 void GeneralPageView::InitStartupGroup() {
665 startup_homepage_radio_ = new views::RadioButton( 671 startup_homepage_radio_ = new views::RadioButton(
666 l10n_util::GetString(IDS_OPTIONS_STARTUP_SHOW_DEFAULT_AND_NEWTAB), 672 l10n_util::GetString(IDS_OPTIONS_STARTUP_SHOW_DEFAULT_AND_NEWTAB),
667 kStartupRadioGroup); 673 kStartupRadioGroup);
668 startup_homepage_radio_->set_listener(this); 674 startup_homepage_radio_->set_listener(this);
669 startup_last_session_radio_ = new views::RadioButton( 675 startup_last_session_radio_ = new views::RadioButton(
670 l10n_util::GetString(IDS_OPTIONS_STARTUP_SHOW_LAST_SESSION), 676 l10n_util::GetString(IDS_OPTIONS_STARTUP_SHOW_LAST_SESSION),
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 homepage_use_url_textfield_->SetEnabled(false); 978 homepage_use_url_textfield_->SetEnabled(false);
973 homepage_use_url_textfield_->SetReadOnly(true); 979 homepage_use_url_textfield_->SetReadOnly(true);
974 } 980 }
975 } 981 }
976 982
977 void GeneralPageView::SetDefaultSearchProvider() { 983 void GeneralPageView::SetDefaultSearchProvider() {
978 const int index = default_search_engine_combobox_->selected_item(); 984 const int index = default_search_engine_combobox_->selected_item();
979 default_search_engines_model_->model()->SetDefaultSearchProvider( 985 default_search_engines_model_->model()->SetDefaultSearchProvider(
980 default_search_engines_model_->GetTemplateURLAt(index)); 986 default_search_engines_model_->GetTemplateURLAt(index));
981 } 987 }
OLDNEW
« chrome/browser/shell_integration_win.cc ('K') | « chrome/browser/shell_integration_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698