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/extensions/extension_web_ui.h" | 5 #include "chrome/browser/extensions/extension_web_ui.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 // static | 327 // static |
328 bool ExtensionWebUI::HandleChromeURLOverrideReverse( | 328 bool ExtensionWebUI::HandleChromeURLOverrideReverse( |
329 GURL* url, content::BrowserContext* browser_context) { | 329 GURL* url, content::BrowserContext* browser_context) { |
330 Profile* profile = Profile::FromBrowserContext(browser_context); | 330 Profile* profile = Profile::FromBrowserContext(browser_context); |
331 const DictionaryValue* overrides = | 331 const DictionaryValue* overrides = |
332 profile->GetPrefs()->GetDictionary(kExtensionURLOverrides); | 332 profile->GetPrefs()->GetDictionary(kExtensionURLOverrides); |
333 if (!overrides) | 333 if (!overrides) |
334 return false; | 334 return false; |
335 | 335 |
336 // Find the reverse mapping based on the given URL. For example this maps the | 336 // Find the reverse mapping based on the given URL. For example this maps the |
337 // internal URL chrome-extension://eemcgdkndhakfknomggombfjeno/main.html#1 to | 337 // internal URL |
| 338 // chrome-extension://eemcgdkfndhakfknompkggombfjjjeno/main.html#1 to |
338 // chrome://bookmarks/#1 for display in the omnibox. | 339 // chrome://bookmarks/#1 for display in the omnibox. |
339 for (DictionaryValue::key_iterator it = overrides->begin_keys(), | 340 for (DictionaryValue::key_iterator it = overrides->begin_keys(), |
340 end = overrides->end_keys(); it != end; ++it) { | 341 end = overrides->end_keys(); it != end; ++it) { |
341 const ListValue* url_list; | 342 const ListValue* url_list; |
342 if (!overrides->GetList(*it, &url_list)) | 343 if (!overrides->GetList(*it, &url_list)) |
343 continue; | 344 continue; |
344 | 345 |
345 for (ListValue::const_iterator it2 = url_list->begin(), | 346 for (ListValue::const_iterator it2 = url_list->begin(), |
346 end2 = url_list->end(); it2 != end2; ++it2) { | 347 end2 = url_list->end(); it2 != end2; ++it2) { |
347 std::string override; | 348 std::string override; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 } | 463 } |
463 | 464 |
464 // static | 465 // static |
465 void ExtensionWebUI::GetFaviconForURL(Profile* profile, | 466 void ExtensionWebUI::GetFaviconForURL(Profile* profile, |
466 FaviconService::GetFaviconRequest* request, const GURL& page_url) { | 467 FaviconService::GetFaviconRequest* request, const GURL& page_url) { |
467 // tracker deletes itself when done. | 468 // tracker deletes itself when done. |
468 ExtensionWebUIImageLoadingTracker* tracker = | 469 ExtensionWebUIImageLoadingTracker* tracker = |
469 new ExtensionWebUIImageLoadingTracker(profile, request, page_url); | 470 new ExtensionWebUIImageLoadingTracker(profile, request, page_url); |
470 tracker->Init(); | 471 tracker->Init(); |
471 } | 472 } |
OLD | NEW |