OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/webui/settings/search_engines_handler.h" | 5 #include "chrome/browser/ui/webui/settings/search_engines_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 GURL icon_url = template_url->favicon_url(); | 177 GURL icon_url = template_url->favicon_url(); |
178 if (icon_url.is_valid()) | 178 if (icon_url.is_valid()) |
179 dict->SetString("iconURL", icon_url.spec()); | 179 dict->SetString("iconURL", icon_url.spec()); |
180 dict->SetInteger("modelIndex", index); | 180 dict->SetInteger("modelIndex", index); |
181 | 181 |
182 dict->SetBoolean("canBeRemoved", list_controller_.CanRemove(template_url)); | 182 dict->SetBoolean("canBeRemoved", list_controller_.CanRemove(template_url)); |
183 dict->SetBoolean("canBeDefault", | 183 dict->SetBoolean("canBeDefault", |
184 list_controller_.CanMakeDefault(template_url)); | 184 list_controller_.CanMakeDefault(template_url)); |
185 dict->SetBoolean("default", is_default); | 185 dict->SetBoolean("default", is_default); |
186 dict->SetBoolean("canBeEdited", list_controller_.CanEdit(template_url)); | 186 dict->SetBoolean("canBeEdited", list_controller_.CanEdit(template_url)); |
187 TemplateURL::Type type = template_url->GetType(); | 187 TemplateURL::Type type = template_url->type(); |
188 dict->SetBoolean("isOmniboxExtension", | 188 dict->SetBoolean("isOmniboxExtension", |
189 type == TemplateURL::OMNIBOX_API_EXTENSION); | 189 type == TemplateURL::OMNIBOX_API_EXTENSION); |
190 if (type == TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION || | 190 if (type == TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION || |
191 type == TemplateURL::OMNIBOX_API_EXTENSION) { | 191 type == TemplateURL::OMNIBOX_API_EXTENSION) { |
192 const extensions::Extension* extension = | 192 const extensions::Extension* extension = |
193 extensions::ExtensionRegistry::Get(Profile::FromWebUI(web_ui())) | 193 extensions::ExtensionRegistry::Get(Profile::FromWebUI(web_ui())) |
194 ->GetExtensionById(template_url->GetExtensionId(), | 194 ->GetExtensionById(template_url->GetExtensionId(), |
195 extensions::ExtensionRegistry::EVERYTHING); | 195 extensions::ExtensionRegistry::EVERYTHING); |
196 if (extension) { | 196 if (extension) { |
197 dict->Set("extension", | 197 dict->Set("extension", |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 std::string extension_id; | 342 std::string extension_id; |
343 CHECK(args->GetString(0, &extension_id)); | 343 CHECK(args->GetString(0, &extension_id)); |
344 ExtensionService* extension_service = | 344 ExtensionService* extension_service = |
345 extensions::ExtensionSystem::Get(profile_)->extension_service(); | 345 extensions::ExtensionSystem::Get(profile_)->extension_service(); |
346 DCHECK(extension_service); | 346 DCHECK(extension_service); |
347 extension_service->DisableExtension( | 347 extension_service->DisableExtension( |
348 extension_id, extensions::Extension::DISABLE_USER_ACTION); | 348 extension_id, extensions::Extension::DISABLE_USER_ACTION); |
349 } | 349 } |
350 | 350 |
351 } // namespace settings | 351 } // namespace settings |
OLD | NEW |