| OLD | NEW |
| 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/gtk/keyword_editor_view.h" | 5 #include "chrome/browser/gtk/keyword_editor_view.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 COL_FAVICON, pixbuf, | 234 COL_FAVICON, pixbuf, |
| 235 // Dunno why, even with COL_WEIGHT_SET to FALSE here, the weight still | 235 // Dunno why, even with COL_WEIGHT_SET to FALSE here, the weight still |
| 236 // has an effect. So we just set it to normal. | 236 // has an effect. So we just set it to normal. |
| 237 COL_WEIGHT, PANGO_WEIGHT_NORMAL, | 237 COL_WEIGHT, PANGO_WEIGHT_NORMAL, |
| 238 COL_WEIGHT_SET, TRUE, | 238 COL_WEIGHT_SET, TRUE, |
| 239 COL_TITLE, WideToUTF8(table_model_->GetText( | 239 COL_TITLE, WideToUTF8(table_model_->GetText( |
| 240 model_row, IDS_SEARCH_ENGINES_EDITOR_DESCRIPTION_COLUMN)).c_str(), | 240 model_row, IDS_SEARCH_ENGINES_EDITOR_DESCRIPTION_COLUMN)).c_str(), |
| 241 COL_KEYWORD, WideToUTF8(table_model_->GetText( | 241 COL_KEYWORD, WideToUTF8(table_model_->GetText( |
| 242 model_row, IDS_SEARCH_ENGINES_EDITOR_KEYWORD_COLUMN)).c_str(), | 242 model_row, IDS_SEARCH_ENGINES_EDITOR_KEYWORD_COLUMN)).c_str(), |
| 243 -1); | 243 -1); |
| 244 g_object_unref(pixbuf); |
| 244 } | 245 } |
| 245 | 246 |
| 246 int KeywordEditorView::GetListStoreRowForModelRow(int model_row) const { | 247 int KeywordEditorView::GetListStoreRowForModelRow(int model_row) const { |
| 247 if (model_row < model_second_group_index_) | 248 if (model_row < model_second_group_index_) |
| 248 return model_row + kFirstGroupRowOffset; | 249 return model_row + kFirstGroupRowOffset; |
| 249 else | 250 else |
| 250 return model_row + kSecondGroupRowOffset; | 251 return model_row + kSecondGroupRowOffset; |
| 251 } | 252 } |
| 252 | 253 |
| 253 int KeywordEditorView::GetModelRowForPath(GtkTreePath* path) const { | 254 int KeywordEditorView::GetModelRowForPath(GtkTreePath* path) const { |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 int model_row = editor->GetSelectedModelRow(); | 494 int model_row = editor->GetSelectedModelRow(); |
| 494 if (model_row == -1) { | 495 if (model_row == -1) { |
| 495 NOTREACHED(); | 496 NOTREACHED(); |
| 496 return; | 497 return; |
| 497 } | 498 } |
| 498 int new_index = editor->controller_->MakeDefaultTemplateURL(model_row); | 499 int new_index = editor->controller_->MakeDefaultTemplateURL(model_row); |
| 499 if (new_index > 0) { | 500 if (new_index > 0) { |
| 500 editor->SelectModelRow(new_index); | 501 editor->SelectModelRow(new_index); |
| 501 } | 502 } |
| 502 } | 503 } |
| OLD | NEW |