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/search_engines/template_url_table_model.h" | 5 #include "chrome/browser/search_engines/template_url_table_model.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | |
9 #include "base/callback.h" | 8 #include "base/callback.h" |
10 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
11 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
12 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
13 #include "chrome/browser/favicon_service.h" | 12 #include "chrome/browser/favicon_service.h" |
14 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/search_engines/template_url.h" | 14 #include "chrome/browser/search_engines/template_url.h" |
16 #include "chrome/browser/search_engines/template_url_model.h" | 15 #include "chrome/browser/search_engines/template_url_model.h" |
17 #include "gfx/codec/png_codec.h" | 16 #include "gfx/codec/png_codec.h" |
18 #include "grit/app_resources.h" | 17 #include "grit/app_resources.h" |
19 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
20 #include "third_party/skia/include/core/SkBitmap.h" | 19 #include "third_party/skia/include/core/SkBitmap.h" |
21 #include "ui/base/models/table_model_observer.h" | 20 #include "ui/base/models/table_model_observer.h" |
| 21 #include "ui/base/resource/resource_bundle.h" |
22 | 22 |
23 // Group IDs used by TemplateURLTableModel. | 23 // Group IDs used by TemplateURLTableModel. |
24 static const int kMainGroupID = 0; | 24 static const int kMainGroupID = 0; |
25 static const int kOtherGroupID = 1; | 25 static const int kOtherGroupID = 1; |
26 | 26 |
27 // ModelEntry ---------------------------------------------------- | 27 // ModelEntry ---------------------------------------------------- |
28 | 28 |
29 // ModelEntry wraps a TemplateURL as returned from the TemplateURL. | 29 // ModelEntry wraps a TemplateURL as returned from the TemplateURL. |
30 // ModelEntry also tracks state information about the URL. | 30 // ModelEntry also tracks state information about the URL. |
31 | 31 |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 void TemplateURLTableModel::FavIconAvailable(ModelEntry* entry) { | 372 void TemplateURLTableModel::FavIconAvailable(ModelEntry* entry) { |
373 std::vector<ModelEntry*>::iterator i = | 373 std::vector<ModelEntry*>::iterator i = |
374 find(entries_.begin(), entries_.end(), entry); | 374 find(entries_.begin(), entries_.end(), entry); |
375 DCHECK(i != entries_.end()); | 375 DCHECK(i != entries_.end()); |
376 NotifyChanged(static_cast<int>(i - entries_.begin())); | 376 NotifyChanged(static_cast<int>(i - entries_.begin())); |
377 } | 377 } |
378 | 378 |
379 void TemplateURLTableModel::OnTemplateURLModelChanged() { | 379 void TemplateURLTableModel::OnTemplateURLModelChanged() { |
380 Reload(); | 380 Reload(); |
381 } | 381 } |
OLD | NEW |