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/search_engines/template_url_table_model.h" | 5 #include "chrome/browser/search_engines/template_url_table_model.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 } | 152 } |
153 | 153 |
154 last_search_engine_index_ = static_cast<int>(entries_.size()); | 154 last_search_engine_index_ = static_cast<int>(entries_.size()); |
155 | 155 |
156 // Then the rest. | 156 // Then the rest. |
157 for (std::vector<const TemplateURL*>::iterator i = urls.begin(); | 157 for (std::vector<const TemplateURL*>::iterator i = urls.begin(); |
158 i != urls.end(); ++i) { | 158 i != urls.end(); ++i) { |
159 const TemplateURL* template_url = *i; | 159 const TemplateURL* template_url = *i; |
160 // NOTE: we don't use ShowInDefaultList here to avoid things bouncing | 160 // NOTE: we don't use ShowInDefaultList here to avoid things bouncing |
161 // the lists while editing. | 161 // the lists while editing. |
162 if (!template_url->show_in_default_list()) | 162 if (!template_url->show_in_default_list() && |
| 163 !template_url->IsExtensionKeyword()) |
163 entries_.push_back(new ModelEntry(this, *template_url)); | 164 entries_.push_back(new ModelEntry(this, *template_url)); |
164 } | 165 } |
165 | 166 |
166 if (observer_) | 167 if (observer_) |
167 observer_->OnModelChanged(); | 168 observer_->OnModelChanged(); |
168 } | 169 } |
169 | 170 |
170 int TemplateURLTableModel::RowCount() { | 171 int TemplateURLTableModel::RowCount() { |
171 return static_cast<int>(entries_.size()); | 172 return static_cast<int>(entries_.size()); |
172 } | 173 } |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 void TemplateURLTableModel::FavIconAvailable(ModelEntry* entry) { | 361 void TemplateURLTableModel::FavIconAvailable(ModelEntry* entry) { |
361 std::vector<ModelEntry*>::iterator i = | 362 std::vector<ModelEntry*>::iterator i = |
362 find(entries_.begin(), entries_.end(), entry); | 363 find(entries_.begin(), entries_.end(), entry); |
363 DCHECK(i != entries_.end()); | 364 DCHECK(i != entries_.end()); |
364 NotifyChanged(static_cast<int>(i - entries_.begin())); | 365 NotifyChanged(static_cast<int>(i - entries_.begin())); |
365 } | 366 } |
366 | 367 |
367 void TemplateURLTableModel::OnTemplateURLModelChanged() { | 368 void TemplateURLTableModel::OnTemplateURLModelChanged() { |
368 Reload(); | 369 Reload(); |
369 } | 370 } |
OLD | NEW |