| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/views/options/exception_editor_view.h" | 5 #include "chrome/browser/ui/views/options/exception_editor_view.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/content_exceptions_table_model.h" | 9 #include "chrome/browser/content_exceptions_table_model.h" |
| 10 #include "googleurl/src/url_canon.h" | 10 #include "googleurl/src/url_canon.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 UTF16ToUTF8(pattern_tf_->text())), is_off_the_record_)); | 116 UTF16ToUTF8(pattern_tf_->text())), is_off_the_record_)); |
| 117 | 117 |
| 118 action_cb_ = new views::Combobox(&cb_model_); | 118 action_cb_ = new views::Combobox(&cb_model_); |
| 119 if (!is_new()) | 119 if (!is_new()) |
| 120 action_cb_->SetSelectedItem(cb_model_.IndexForSetting(setting_)); | 120 action_cb_->SetSelectedItem(cb_model_.IndexForSetting(setting_)); |
| 121 | 121 |
| 122 incognito_cb_ = new views::Checkbox( | 122 incognito_cb_ = new views::Checkbox( |
| 123 UTF16ToWide(l10n_util::GetStringUTF16(IDS_EXCEPTION_EDITOR_OTR_TITLE))); | 123 UTF16ToWide(l10n_util::GetStringUTF16(IDS_EXCEPTION_EDITOR_OTR_TITLE))); |
| 124 incognito_cb_->SetChecked(is_off_the_record_); | 124 incognito_cb_->SetChecked(is_off_the_record_); |
| 125 | 125 |
| 126 GridLayout* layout = CreatePanelGridLayout(this); | 126 GridLayout* layout = GridLayout::CreatePanel(this); |
| 127 SetLayoutManager(layout); | 127 SetLayoutManager(layout); |
| 128 | 128 |
| 129 // For the Textfields. | 129 // For the Textfields. |
| 130 views::ColumnSet* column_set = layout->AddColumnSet(1); | 130 views::ColumnSet* column_set = layout->AddColumnSet(1); |
| 131 column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0, | 131 column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0, |
| 132 GridLayout::USE_PREF, 0, 0); | 132 GridLayout::USE_PREF, 0, 0); |
| 133 column_set->AddPaddingColumn(0, kRelatedControlHorizontalSpacing); | 133 column_set->AddPaddingColumn(0, kRelatedControlHorizontalSpacing); |
| 134 column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1, | 134 column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1, |
| 135 GridLayout::USE_PREF, 0, 0); | 135 GridLayout::USE_PREF, 0, 0); |
| 136 column_set->AddPaddingColumn(0, kRelatedControlHorizontalSpacing); | 136 column_set->AddPaddingColumn(0, kRelatedControlHorizontalSpacing); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 return is_new() ? is_valid_pattern : (!pattern.AsString().empty() && | 169 return is_new() ? is_valid_pattern : (!pattern.AsString().empty() && |
| 170 ((pattern_ == pattern) || is_valid_pattern)); | 170 ((pattern_ == pattern) || is_valid_pattern)); |
| 171 } | 171 } |
| 172 | 172 |
| 173 void ExceptionEditorView::UpdateImageView(views::ImageView* image_view, | 173 void ExceptionEditorView::UpdateImageView(views::ImageView* image_view, |
| 174 bool is_valid) { | 174 bool is_valid) { |
| 175 return image_view->SetImage( | 175 return image_view->SetImage( |
| 176 ResourceBundle::GetSharedInstance().GetBitmapNamed( | 176 ResourceBundle::GetSharedInstance().GetBitmapNamed( |
| 177 is_valid ? IDR_INPUT_GOOD : IDR_INPUT_ALERT)); | 177 is_valid ? IDR_INPUT_GOOD : IDR_INPUT_ALERT)); |
| 178 } | 178 } |
| OLD | NEW |