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

Side by Side Diff: chrome/browser/chromeos/options/language_mozc_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
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_mozc_config_view.h" 5 #include "chrome/browser/chromeos/options/language_mozc_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/browser/chromeos/cros/cros_library.h" 10 #include "chrome/browser/chromeos/cros/cros_library.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 } 103 }
104 DCHECK(pref_id < kNumMozcIntegerPrefs); 104 DCHECK(pref_id < kNumMozcIntegerPrefs);
105 prefs_and_sliders_[pref_id].integer_pref.SetValue(sender->value()); 105 prefs_and_sliders_[pref_id].integer_pref.SetValue(sender->value());
106 } 106 }
107 107
108 void LanguageMozcConfigView::Layout() { 108 void LanguageMozcConfigView::Layout() {
109 // Not sure why but this is needed to show contents in the dialog. 109 // Not sure why but this is needed to show contents in the dialog.
110 contents_->SetBounds(0, 0, width(), height()); 110 contents_->SetBounds(0, 0, width(), height());
111 } 111 }
112 112
113 int LanguageMozcConfigView::GetDialogButtons() const {
114 return MessageBoxFlags::DIALOGBUTTON_OK;
115 }
116
117 std::wstring LanguageMozcConfigView::GetDialogButtonLabel(
118 MessageBoxFlags::DialogButton button) const {
119 if (button == MessageBoxFlags::DIALOGBUTTON_OK) {
120 return l10n_util::GetString(IDS_OK);
121 }
122 return L"";
123 }
124
113 std::wstring LanguageMozcConfigView::GetWindowTitle() const { 125 std::wstring LanguageMozcConfigView::GetWindowTitle() const {
114 return l10n_util::GetString( 126 return l10n_util::GetString(
115 IDS_OPTIONS_SETTINGS_LANGUAGES_MOZC_SETTINGS_TITLE); 127 IDS_OPTIONS_SETTINGS_LANGUAGES_MOZC_SETTINGS_TITLE);
116 } 128 }
117 129
118 gfx::Size LanguageMozcConfigView::GetPreferredSize() { 130 gfx::Size LanguageMozcConfigView::GetPreferredSize() {
119 // TODO(satorux): Create our own localized content size once the UI is done. 131 // TODO(satorux): Create our own localized content size once the UI is done.
120 gfx::Size preferred_size = views::Window::GetLocalizedContentsSize( 132 gfx::Size preferred_size = views::Window::GetLocalizedContentsSize(
121 IDS_LANGUAGES_INPUT_DIALOG_WIDTH_CHARS, 133 IDS_LANGUAGES_INPUT_DIALOG_WIDTH_CHARS,
122 IDS_LANGUAGES_INPUT_DIALOG_HEIGHT_LINES); 134 IDS_LANGUAGES_INPUT_DIALOG_HEIGHT_LINES);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 } 258 }
247 for (size_t i = 0; i < kNumMozcIntegerPrefs; ++i) { 259 for (size_t i = 0; i < kNumMozcIntegerPrefs; ++i) {
248 prefs_and_sliders_[i].integer_pref.SetValue( 260 prefs_and_sliders_[i].integer_pref.SetValue(
249 kMozcIntegerPrefs[i].default_pref_value); 261 kMozcIntegerPrefs[i].default_pref_value);
250 } 262 }
251 // Reflect the preference changes to the controls. 263 // Reflect the preference changes to the controls.
252 NotifyPrefChanged(); 264 NotifyPrefChanged();
253 } 265 }
254 266
255 } // namespace chromeos 267 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698