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

Side by Side Diff: chrome/browser/chromeos/options/language_pinyin_config_view.cc

Issue 2799052: Hide cancel buttons on configuration dialogs. (Closed)
Patch Set: Created 10 years, 5 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
« no previous file with comments | « chrome/browser/chromeos/options/language_pinyin_config_view.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/chromeos/options/language_pinyin_config_view.h" 5 #include "chrome/browser/chromeos/options/language_pinyin_config_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 "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/common/notification_type.h" 10 #include "chrome/common/notification_type.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // Update the Chrome pref. 59 // Update the Chrome pref.
60 double_pinyin_schema_.multiple_choice_pref.SetValue(config_value); 60 double_pinyin_schema_.multiple_choice_pref.SetValue(config_value);
61 } 61 }
62 } 62 }
63 63
64 void LanguagePinyinConfigView::Layout() { 64 void LanguagePinyinConfigView::Layout() {
65 // Not sure why but this is needed to show contents in the dialog. 65 // Not sure why but this is needed to show contents in the dialog.
66 contents_->SetBounds(0, 0, width(), height()); 66 contents_->SetBounds(0, 0, width(), height());
67 } 67 }
68 68
69 int LanguagePinyinConfigView::GetDialogButtons() const {
70 return MessageBoxFlags::DIALOGBUTTON_OK;
71 }
72
73 std::wstring LanguagePinyinConfigView::GetDialogButtonLabel(
74 MessageBoxFlags::DialogButton button) const {
75 if (button == MessageBoxFlags::DIALOGBUTTON_OK) {
76 return l10n_util::GetString(IDS_OK);
77 }
78 return L"";
79 }
80
69 std::wstring LanguagePinyinConfigView::GetWindowTitle() const { 81 std::wstring LanguagePinyinConfigView::GetWindowTitle() const {
70 return l10n_util::GetString( 82 return l10n_util::GetString(
71 IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTINGS_TITLE); 83 IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTINGS_TITLE);
72 } 84 }
73 85
74 gfx::Size LanguagePinyinConfigView::GetPreferredSize() { 86 gfx::Size LanguagePinyinConfigView::GetPreferredSize() {
75 // TODO(satorux): Create our own localized content size once the UI is done. 87 // TODO(satorux): Create our own localized content size once the UI is done.
76 return gfx::Size(views::Window::GetLocalizedContentsSize( 88 return gfx::Size(views::Window::GetLocalizedContentsSize(
77 IDS_LANGUAGES_INPUT_DIALOG_WIDTH_CHARS, 89 IDS_LANGUAGES_INPUT_DIALOG_WIDTH_CHARS,
78 IDS_LANGUAGES_INPUT_DIALOG_HEIGHT_LINES)); 90 IDS_LANGUAGES_INPUT_DIALOG_HEIGHT_LINES));
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 const int value = double_pinyin_schema_.multiple_choice_pref.GetValue(); 147 const int value = double_pinyin_schema_.multiple_choice_pref.GetValue();
136 for (int i = 0; i < double_pinyin_schema_.combobox_model->num_items(); ++i) { 148 for (int i = 0; i < double_pinyin_schema_.combobox_model->num_items(); ++i) {
137 if (double_pinyin_schema_.combobox_model->GetConfigValueAt(i) == value) { 149 if (double_pinyin_schema_.combobox_model->GetConfigValueAt(i) == value) {
138 double_pinyin_schema_.combobox->SetSelectedItem(i); 150 double_pinyin_schema_.combobox->SetSelectedItem(i);
139 break; 151 break;
140 } 152 }
141 } 153 }
142 } 154 }
143 155
144 } // namespace chromeos 156 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/options/language_pinyin_config_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698