OLD | NEW |
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 "ui/app_list/app_list_model.h" | 5 #include "ui/app_list/app_list_model.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "ui/app_list/app_list_folder_item.h" | 10 #include "ui/app_list/app_list_folder_item.h" |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 | 349 |
350 --custom_launcher_page_subpage_depth_; | 350 --custom_launcher_page_subpage_depth_; |
351 return true; | 351 return true; |
352 } | 352 } |
353 | 353 |
354 void AppListModel::ClearCustomLauncherPageSubpages() { | 354 void AppListModel::ClearCustomLauncherPageSubpages() { |
355 custom_launcher_page_subpage_depth_ = 0; | 355 custom_launcher_page_subpage_depth_ = 0; |
356 } | 356 } |
357 | 357 |
358 void AppListModel::SetSearchEngineIsGoogle(bool is_google) { | 358 void AppListModel::SetSearchEngineIsGoogle(bool is_google) { |
| 359 if (search_engine_is_google_ == is_google) |
| 360 return; |
| 361 |
359 search_engine_is_google_ = is_google; | 362 search_engine_is_google_ = is_google; |
360 for (auto& observer : observers_) | 363 for (auto& observer : observers_) |
361 observer.OnSearchEngineIsGoogleChanged(is_google); | 364 observer.OnSearchEngineIsGoogleChanged(is_google); |
362 } | 365 } |
363 | 366 |
364 void AppListModel::SetSearchAnswerAvailable(bool has_answer) { | 367 void AppListModel::SetSearchAnswerAvailable(bool has_answer) { |
365 for (auto& observer : observers_) | 368 for (auto& observer : observers_) |
366 observer.OnSearchAnswerAvailableChanged(has_answer); | 369 observer.OnSearchAnswerAvailableChanged(has_answer); |
367 } | 370 } |
368 | 371 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 folder->item_list()->RemoveItem(item->id()); | 448 folder->item_list()->RemoveItem(item->id()); |
446 result->set_folder_id(""); | 449 result->set_folder_id(""); |
447 if (folder->item_list()->item_count() == 0) { | 450 if (folder->item_list()->item_count() == 0) { |
448 DVLOG(2) << "Deleting empty folder: " << folder->ToDebugString(); | 451 DVLOG(2) << "Deleting empty folder: " << folder->ToDebugString(); |
449 DeleteItem(folder_id); | 452 DeleteItem(folder_id); |
450 } | 453 } |
451 return result; | 454 return result; |
452 } | 455 } |
453 | 456 |
454 } // namespace app_list | 457 } // namespace app_list |
OLD | NEW |