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/views/options/general_page_view.h" | 5 #include "chrome/browser/views/options/general_page_view.h" |
6 | 6 |
7 #include "app/combobox_model.h" | 7 #include "app/combobox_model.h" |
8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 } | 149 } |
150 // Complete change, so tell the view to just rebuild itself. | 150 // Complete change, so tell the view to just rebuild itself. |
151 if (observer_) | 151 if (observer_) |
152 observer_->OnModelChanged(); | 152 observer_->OnModelChanged(); |
153 } | 153 } |
154 | 154 |
155 void CustomHomePagesTableModel::Add(int index, const GURL& url) { | 155 void CustomHomePagesTableModel::Add(int index, const GURL& url) { |
156 DCHECK(index >= 0 && index <= RowCount()); | 156 DCHECK(index >= 0 && index <= RowCount()); |
157 entries_.insert(entries_.begin() + static_cast<size_t>(index), Entry()); | 157 entries_.insert(entries_.begin() + static_cast<size_t>(index), Entry()); |
158 entries_[index].url = url; | 158 entries_[index].url = url; |
159 LoadFavIcon(&(entries_[index])); | |
160 if (observer_) | 159 if (observer_) |
161 observer_->OnItemsAdded(index, 1); | 160 observer_->OnItemsAdded(index, 1); |
162 } | 161 } |
163 | 162 |
164 void CustomHomePagesTableModel::Remove(int index) { | 163 void CustomHomePagesTableModel::Remove(int index) { |
165 DCHECK(index >= 0 && index < RowCount()); | 164 DCHECK(index >= 0 && index < RowCount()); |
166 Entry* entry = &(entries_[index]); | 165 Entry* entry = &(entries_[index]); |
167 if (entry->fav_icon_handle) { | 166 if (entry->fav_icon_handle) { |
168 // Pending load request, cancel it now so we don't deref a bogus pointer | 167 // Pending load request, cancel it now so we don't deref a bogus pointer |
169 // when we get loaded notification. | 168 // when we get loaded notification. |
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1012 homepage_use_url_textfield_->SetEnabled(false); | 1011 homepage_use_url_textfield_->SetEnabled(false); |
1013 homepage_use_url_textfield_->SetReadOnly(true); | 1012 homepage_use_url_textfield_->SetReadOnly(true); |
1014 } | 1013 } |
1015 } | 1014 } |
1016 | 1015 |
1017 void GeneralPageView::SetDefaultSearchProvider() { | 1016 void GeneralPageView::SetDefaultSearchProvider() { |
1018 const int index = default_search_engine_combobox_->selected_item(); | 1017 const int index = default_search_engine_combobox_->selected_item(); |
1019 default_search_engines_model_->model()->SetDefaultSearchProvider( | 1018 default_search_engines_model_->model()->SetDefaultSearchProvider( |
1020 default_search_engines_model_->GetTemplateURLAt(index)); | 1019 default_search_engines_model_->GetTemplateURLAt(index)); |
1021 } | 1020 } |
OLD | NEW |