Chromium Code Reviews| 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/extensions/extension_dom_ui.h" | 5 #include "chrome/browser/extensions/extension_dom_ui.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "net/base/file_stream.h" | 9 #include "net/base/file_stream.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 232 | 232 |
| 233 const DictionaryValue* overrides = | 233 const DictionaryValue* overrides = |
| 234 profile->GetPrefs()->GetDictionary(kExtensionURLOverrides); | 234 profile->GetPrefs()->GetDictionary(kExtensionURLOverrides); |
| 235 std::string page = url->host(); | 235 std::string page = url->host(); |
| 236 ListValue* url_list; | 236 ListValue* url_list; |
| 237 if (!overrides || !overrides->GetList(page, &url_list)) | 237 if (!overrides || !overrides->GetList(page, &url_list)) |
| 238 return false; | 238 return false; |
| 239 | 239 |
| 240 ExtensionsService* service = profile->GetExtensionsService(); | 240 ExtensionsService* service = profile->GetExtensionsService(); |
| 241 if (!service->is_ready()) { | 241 if (!service->is_ready()) { |
| 242 // TODO(erikkay) So far, it looks like extensions load before the new tab | |
| 243 // page. I don't know if we have anything that enforces this, so add this | |
| 244 // check for safety. | |
| 245 NOTREACHED() << "Chrome URL override requested before extensions loaded"; | 242 NOTREACHED() << "Chrome URL override requested before extensions loaded"; |
|
Sam Kerner (Chrome)
2010/11/17 05:07:36
Comment is obsolete now that extensions service lo
Aaron Boodman
2010/11/17 06:12:47
In that case, you can remove this check completely
Sam Kerner (Chrome)
2010/11/18 03:53:36
ExtensionsService::ready_ is set to false in the e
| |
| 246 return false; | 243 return false; |
| 247 } | 244 } |
| 248 | 245 |
| 249 size_t i = 0; | 246 size_t i = 0; |
| 250 while (i < url_list->GetSize()) { | 247 while (i < url_list->GetSize()) { |
| 251 Value* val = NULL; | 248 Value* val = NULL; |
| 252 url_list->Get(i, &val); | 249 url_list->Get(i, &val); |
| 253 | 250 |
| 254 // Verify that the override value is good. If not, unregister it and find | 251 // Verify that the override value is good. If not, unregister it and find |
| 255 // the next one. | 252 // the next one. |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 402 } | 399 } |
| 403 | 400 |
| 404 // static | 401 // static |
| 405 void ExtensionDOMUI::GetFaviconForURL(Profile* profile, | 402 void ExtensionDOMUI::GetFaviconForURL(Profile* profile, |
| 406 FaviconService::GetFaviconRequest* request, const GURL& page_url) { | 403 FaviconService::GetFaviconRequest* request, const GURL& page_url) { |
| 407 // tracker deletes itself when done. | 404 // tracker deletes itself when done. |
| 408 ExtensionDOMUIImageLoadingTracker* tracker = | 405 ExtensionDOMUIImageLoadingTracker* tracker = |
| 409 new ExtensionDOMUIImageLoadingTracker(profile, request, page_url); | 406 new ExtensionDOMUIImageLoadingTracker(profile, request, page_url); |
| 410 tracker->Init(); | 407 tracker->Init(); |
| 411 } | 408 } |
| OLD | NEW |