| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 121 |
| 122 DISALLOW_COPY_AND_ASSIGN(ExtensionWebUIImageLoadingTracker); | 122 DISALLOW_COPY_AND_ASSIGN(ExtensionWebUIImageLoadingTracker); |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 } // namespace | 125 } // namespace |
| 126 | 126 |
| 127 const char ExtensionWebUI::kExtensionURLOverrides[] = | 127 const char ExtensionWebUI::kExtensionURLOverrides[] = |
| 128 "extensions.chrome_url_overrides"; | 128 "extensions.chrome_url_overrides"; |
| 129 | 129 |
| 130 ExtensionWebUI::ExtensionWebUI(WebContents* web_contents, const GURL& url) | 130 ExtensionWebUI::ExtensionWebUI(WebContents* web_contents, const GURL& url) |
| 131 : WebUI(web_contents), | 131 : WebUI(web_contents, this), |
| 132 url_(url) { | 132 url_(url) { |
| 133 Profile* profile = | 133 Profile* profile = |
| 134 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | 134 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
| 135 ExtensionService* service = profile->GetExtensionService(); | 135 ExtensionService* service = profile->GetExtensionService(); |
| 136 const Extension* extension = | 136 const Extension* extension = |
| 137 service->extensions()->GetExtensionOrAppByURL(ExtensionURLInfo(url)); | 137 service->extensions()->GetExtensionOrAppByURL(ExtensionURLInfo(url)); |
| 138 DCHECK(extension); | 138 DCHECK(extension); |
| 139 // Only hide the url for internal pages (e.g. chrome-extension or packaged | 139 // Only hide the url for internal pages (e.g. chrome-extension or packaged |
| 140 // component apps like bookmark manager. | 140 // component apps like bookmark manager. |
| 141 should_hide_url_ = !extension->is_hosted_app(); | 141 should_hide_url_ = !extension->is_hosted_app(); |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 } | 405 } |
| 406 | 406 |
| 407 // static | 407 // static |
| 408 void ExtensionWebUI::GetFaviconForURL(Profile* profile, | 408 void ExtensionWebUI::GetFaviconForURL(Profile* profile, |
| 409 FaviconService::GetFaviconRequest* request, const GURL& page_url) { | 409 FaviconService::GetFaviconRequest* request, const GURL& page_url) { |
| 410 // tracker deletes itself when done. | 410 // tracker deletes itself when done. |
| 411 ExtensionWebUIImageLoadingTracker* tracker = | 411 ExtensionWebUIImageLoadingTracker* tracker = |
| 412 new ExtensionWebUIImageLoadingTracker(profile, request, page_url); | 412 new ExtensionWebUIImageLoadingTracker(profile, request, page_url); |
| 413 tracker->Init(); | 413 tracker->Init(); |
| 414 } | 414 } |
| OLD | NEW |