| 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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 template_url->keyword() == keyword && | 407 template_url->keyword() == keyword && |
| 408 ((url.empty() && !template_url->url()) || | 408 ((url.empty() && !template_url->url()) || |
| 409 (!url.empty() && template_url->url() && | 409 (!url.empty() && template_url->url() && |
| 410 template_url->url()->url() == url))) { | 410 template_url->url()->url() == url))) { |
| 411 return; | 411 return; |
| 412 } | 412 } |
| 413 | 413 |
| 414 url_model_->RemoveObserver(this); | 414 url_model_->RemoveObserver(this); |
| 415 url_model_->ResetTemplateURL(template_url, title, keyword, url); | 415 url_model_->ResetTemplateURL(template_url, title, keyword, url); |
| 416 if (url_model_->GetDefaultSearchProvider() == template_url && | 416 if (url_model_->GetDefaultSearchProvider() == template_url && |
| 417 (!template_url->url() || !template_url->url()->SupportsReplacement())) { | 417 !TemplateURL::SupportsReplacement(template_url)) { |
| 418 // The entry was the default search provider, but the url has been modified | 418 // The entry was the default search provider, but the url has been modified |
| 419 // so that it no longer supports replacement. Reset the default search | 419 // so that it no longer supports replacement. Reset the default search |
| 420 // provider so that it doesn't point to a bogus entry. | 420 // provider so that it doesn't point to a bogus entry. |
| 421 url_model_->SetDefaultSearchProvider(NULL); | 421 url_model_->SetDefaultSearchProvider(NULL); |
| 422 } | 422 } |
| 423 url_model_->AddObserver(this); | 423 url_model_->AddObserver(this); |
| 424 table_model_->ReloadIcon(index); // Also calls NotifyChanged(). | 424 table_model_->ReloadIcon(index); // Also calls NotifyChanged(). |
| 425 | 425 |
| 426 // Force the make default button to update. | 426 // Force the make default button to update. |
| 427 OnSelectionChanged(); | 427 OnSelectionChanged(); |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 } | 634 } |
| 635 const int new_index = table_model_->IndexOfTemplateURL(keyword); | 635 const int new_index = table_model_->IndexOfTemplateURL(keyword); |
| 636 table_model_->NotifyChanged(new_index); | 636 table_model_->NotifyChanged(new_index); |
| 637 | 637 |
| 638 // Make sure the new default is in the main group. | 638 // Make sure the new default is in the main group. |
| 639 table_model_->MoveToMainGroup(index); | 639 table_model_->MoveToMainGroup(index); |
| 640 | 640 |
| 641 // And select it. | 641 // And select it. |
| 642 table_view_->Select(table_model_->IndexOfTemplateURL(keyword)); | 642 table_view_->Select(table_model_->IndexOfTemplateURL(keyword)); |
| 643 } | 643 } |
| OLD | NEW |