| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/keyword_editor_view.h" | 5 #include "chrome/browser/views/keyword_editor_view.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/gfx/png_decoder.h" | 9 #include "base/gfx/png_decoder.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 OnSelectionChanged(); | 419 OnSelectionChanged(); |
| 420 | 420 |
| 421 UserMetrics::RecordAction(L"KeywordEditor_ModifiedKeyword", profile_); | 421 UserMetrics::RecordAction(L"KeywordEditor_ModifiedKeyword", profile_); |
| 422 } | 422 } |
| 423 | 423 |
| 424 void KeywordEditorView::DidChangeBounds(const CRect& previous, | 424 void KeywordEditorView::DidChangeBounds(const CRect& previous, |
| 425 const CRect& current) { | 425 const CRect& current) { |
| 426 Layout(); | 426 Layout(); |
| 427 } | 427 } |
| 428 | 428 |
| 429 void KeywordEditorView::GetPreferredSize(CSize* out) { | 429 gfx::Size KeywordEditorView::GetPreferredSize() { |
| 430 DCHECK(out); | 430 return gfx::Size(ChromeViews::Window::GetLocalizedContentsSize( |
| 431 *out = ChromeViews::Window::GetLocalizedContentsSize( | |
| 432 IDS_SEARCHENGINES_DIALOG_WIDTH_CHARS, | 431 IDS_SEARCHENGINES_DIALOG_WIDTH_CHARS, |
| 433 IDS_SEARCHENGINES_DIALOG_HEIGHT_LINES).ToSIZE(); | 432 IDS_SEARCHENGINES_DIALOG_HEIGHT_LINES)); |
| 434 } | 433 } |
| 435 | 434 |
| 436 bool KeywordEditorView::CanResize() const { | 435 bool KeywordEditorView::CanResize() const { |
| 437 return true; | 436 return true; |
| 438 } | 437 } |
| 439 | 438 |
| 440 std::wstring KeywordEditorView::GetWindowTitle() const { | 439 std::wstring KeywordEditorView::GetWindowTitle() const { |
| 441 return l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_WINDOW_TITLE); | 440 return l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_WINDOW_TITLE); |
| 442 } | 441 } |
| 443 | 442 |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 } | 678 } |
| 680 const int new_index = table_model_->IndexOfTemplateURL(keyword); | 679 const int new_index = table_model_->IndexOfTemplateURL(keyword); |
| 681 table_model_->NotifyChanged(new_index); | 680 table_model_->NotifyChanged(new_index); |
| 682 | 681 |
| 683 // Make sure the new default is in the main group. | 682 // Make sure the new default is in the main group. |
| 684 table_model_->MoveToMainGroup(index); | 683 table_model_->MoveToMainGroup(index); |
| 685 | 684 |
| 686 // And select it. | 685 // And select it. |
| 687 table_view_->Select(table_model_->IndexOfTemplateURL(keyword)); | 686 table_view_->Select(table_model_->IndexOfTemplateURL(keyword)); |
| 688 } | 687 } |
| OLD | NEW |