Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: chrome/browser/ui/search_engines/template_url_table_model.cc

Issue 137263007: Move CancelableTaskTracker to //base/task/CancelableTaskTracker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move to base/task/cancelable_task_tracker* Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/search_engines/template_url_table_model.h" 5 #include "chrome/browser/ui/search_engines/template_url_table_model.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
11 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
12 #include "base/task/cancelable_task_tracker.h"
12 #include "chrome/browser/favicon/favicon_service.h" 13 #include "chrome/browser/favicon/favicon_service.h"
13 #include "chrome/browser/favicon/favicon_service_factory.h" 14 #include "chrome/browser/favicon/favicon_service_factory.h"
14 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
15 #include "chrome/browser/search_engines/template_url.h" 16 #include "chrome/browser/search_engines/template_url.h"
16 #include "chrome/browser/search_engines/template_url_service.h" 17 #include "chrome/browser/search_engines/template_url_service.h"
17 #include "chrome/common/cancelable_task_tracker.h"
18 #include "chrome/common/favicon/favicon_types.h" 18 #include "chrome/common/favicon/favicon_types.h"
19 #include "grit/generated_resources.h" 19 #include "grit/generated_resources.h"
20 #include "grit/ui_resources.h" 20 #include "grit/ui_resources.h"
21 #include "third_party/skia/include/core/SkBitmap.h" 21 #include "third_party/skia/include/core/SkBitmap.h"
22 #include "ui/base/l10n/l10n_util.h" 22 #include "ui/base/l10n/l10n_util.h"
23 #include "ui/base/models/table_model_observer.h" 23 #include "ui/base/models/table_model_observer.h"
24 #include "ui/base/resource/resource_bundle.h" 24 #include "ui/base/resource/resource_bundle.h"
25 #include "ui/gfx/favicon_size.h" 25 #include "ui/gfx/favicon_size.h"
26 #include "ui/gfx/image/image_skia.h" 26 #include "ui/gfx/image/image_skia.h"
27 27
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 if (!image_result.image.IsEmpty()) { 107 if (!image_result.image.IsEmpty()) {
108 favicon_ = image_result.image.AsImageSkia(); 108 favicon_ = image_result.image.AsImageSkia();
109 model_->FaviconAvailable(this); 109 model_->FaviconAvailable(this);
110 } 110 }
111 } 111 }
112 112
113 TemplateURL* template_url_; 113 TemplateURL* template_url_;
114 gfx::ImageSkia favicon_; 114 gfx::ImageSkia favicon_;
115 LoadState load_state_; 115 LoadState load_state_;
116 TemplateURLTableModel* model_; 116 TemplateURLTableModel* model_;
117 CancelableTaskTracker tracker_; 117 base::CancelableTaskTracker tracker_;
118 118
119 DISALLOW_COPY_AND_ASSIGN(ModelEntry); 119 DISALLOW_COPY_AND_ASSIGN(ModelEntry);
120 }; 120 };
121 121
122 // TemplateURLTableModel ----------------------------------------- 122 // TemplateURLTableModel -----------------------------------------
123 123
124 TemplateURLTableModel::TemplateURLTableModel( 124 TemplateURLTableModel::TemplateURLTableModel(
125 TemplateURLService* template_url_service) 125 TemplateURLService* template_url_service)
126 : observer_(NULL), 126 : observer_(NULL),
127 template_url_service_(template_url_service) { 127 template_url_service_(template_url_service) {
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 return entry.Pass(); 389 return entry.Pass();
390 } 390 }
391 391
392 void TemplateURLTableModel::AddEntry(int index, scoped_ptr<ModelEntry> entry) { 392 void TemplateURLTableModel::AddEntry(int index, scoped_ptr<ModelEntry> entry) {
393 entries_.insert(entries_.begin() + index, entry.release()); 393 entries_.insert(entries_.begin() + index, entry.release());
394 if (index <= last_other_engine_index_) 394 if (index <= last_other_engine_index_)
395 ++last_other_engine_index_; 395 ++last_other_engine_index_;
396 if (observer_) 396 if (observer_)
397 observer_->OnItemsAdded(index, 1); 397 observer_->OnItemsAdded(index, 1);
398 } 398 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/download/download_item_gtk.h ('k') | chrome/browser/ui/toolbar/back_forward_menu_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698