| 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 "chrome/browser/ui/app_list/apps_model_builder.h" | 5 #include "chrome/browser/ui/app_list/apps_model_builder.h" |
| 6 | 6 |
| 7 #include "base/i18n/case_conversion.h" | 7 #include "base/i18n/case_conversion.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 147 |
| 148 bool is_guest_session = Profile::IsGuestSession(); | 148 bool is_guest_session = Profile::IsGuestSession(); |
| 149 ExtensionService* service = profile_->GetExtensionService(); | 149 ExtensionService* service = profile_->GetExtensionService(); |
| 150 DCHECK(service); | 150 DCHECK(service); |
| 151 for (size_t i = 0; i < arraysize(kSpecialApps); ++i) { | 151 for (size_t i = 0; i < arraysize(kSpecialApps); ++i) { |
| 152 const std::string extension_id(kSpecialApps[i]); | 152 const std::string extension_id(kSpecialApps[i]); |
| 153 if (is_guest_session && extension_id == extension_misc::kWebStoreAppId) | 153 if (is_guest_session && extension_id == extension_misc::kWebStoreAppId) |
| 154 continue; | 154 continue; |
| 155 | 155 |
| 156 const Extension* extension = service->GetInstalledExtension(extension_id); | 156 const Extension* extension = service->GetInstalledExtension(extension_id); |
| 157 DCHECK(extension); | 157 if (!extension) |
| 158 continue; |
| 158 | 159 |
| 159 model_->Add(new ExtensionAppItem(profile_, extension, controller_)); | 160 model_->Add(new ExtensionAppItem(profile_, extension, controller_)); |
| 160 } | 161 } |
| 161 | 162 |
| 162 special_apps_count_ = model_->item_count(); | 163 special_apps_count_ = model_->item_count(); |
| 163 } | 164 } |
| 164 | 165 |
| 165 int AppsModelBuilder::FindApp(const std::string& app_id) { | 166 int AppsModelBuilder::FindApp(const std::string& app_id) { |
| 166 DCHECK(model_); | 167 DCHECK(model_); |
| 167 for (size_t i = special_apps_count_; i < model_->item_count(); ++i) { | 168 for (size_t i = special_apps_count_; i < model_->item_count(); ++i) { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 } | 220 } |
| 220 case chrome::NOTIFICATION_APP_INSTALLED_TO_APPLIST: { | 221 case chrome::NOTIFICATION_APP_INSTALLED_TO_APPLIST: { |
| 221 highlight_app_id_ = *content::Details<const std::string>(details).ptr(); | 222 highlight_app_id_ = *content::Details<const std::string>(details).ptr(); |
| 222 HighlightApp(); | 223 HighlightApp(); |
| 223 break; | 224 break; |
| 224 } | 225 } |
| 225 default: | 226 default: |
| 226 NOTREACHED(); | 227 NOTREACHED(); |
| 227 } | 228 } |
| 228 } | 229 } |
| OLD | NEW |