| 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/api/management/management_api.h" | 5 #include "chrome/browser/extensions/api/management/management_api.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "extensions/browser/management_policy.h" | 46 #include "extensions/browser/management_policy.h" |
| 47 #include "extensions/common/constants.h" | 47 #include "extensions/common/constants.h" |
| 48 #include "extensions/common/error_utils.h" | 48 #include "extensions/common/error_utils.h" |
| 49 #include "extensions/common/extension.h" | 49 #include "extensions/common/extension.h" |
| 50 #include "extensions/common/extension_icon_set.h" | 50 #include "extensions/common/extension_icon_set.h" |
| 51 #include "extensions/common/manifest_handlers/icons_handler.h" | 51 #include "extensions/common/manifest_handlers/icons_handler.h" |
| 52 #include "extensions/common/manifest_handlers/offline_enabled_info.h" | 52 #include "extensions/common/manifest_handlers/offline_enabled_info.h" |
| 53 #include "extensions/common/permissions/permission_set.h" | 53 #include "extensions/common/permissions/permission_set.h" |
| 54 #include "extensions/common/permissions/permissions_data.h" | 54 #include "extensions/common/permissions/permissions_data.h" |
| 55 #include "extensions/common/url_pattern.h" | 55 #include "extensions/common/url_pattern.h" |
| 56 #include "ui/gfx/favicon_size.h" | |
| 57 | 56 |
| 58 using base::IntToString; | 57 using base::IntToString; |
| 59 using content::BrowserThread; | 58 using content::BrowserThread; |
| 60 using content::UtilityProcessHost; | 59 using content::UtilityProcessHost; |
| 61 using content::UtilityProcessHostClient; | 60 using content::UtilityProcessHostClient; |
| 62 | 61 |
| 63 namespace keys = extension_management_api_constants; | 62 namespace keys = extension_management_api_constants; |
| 64 | 63 |
| 65 namespace extensions { | 64 namespace extensions { |
| 66 | 65 |
| (...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 | 907 |
| 909 FaviconService* favicon_service = | 908 FaviconService* favicon_service = |
| 910 FaviconServiceFactory::GetForProfile(GetProfile(), | 909 FaviconServiceFactory::GetForProfile(GetProfile(), |
| 911 Profile::EXPLICIT_ACCESS); | 910 Profile::EXPLICIT_ACCESS); |
| 912 DCHECK(favicon_service); | 911 DCHECK(favicon_service); |
| 913 | 912 |
| 914 title_ = params->title; | 913 title_ = params->title; |
| 915 launch_url_ = launch_url; | 914 launch_url_ = launch_url; |
| 916 | 915 |
| 917 favicon_service->GetFaviconImageForPageURL( | 916 favicon_service->GetFaviconImageForPageURL( |
| 918 FaviconService::FaviconForPageURLParams( | 917 launch_url, |
| 919 launch_url, favicon_base::FAVICON, gfx::kFaviconSize), | |
| 920 base::Bind(&ManagementGenerateAppForLinkFunction::OnFaviconForApp, this), | 918 base::Bind(&ManagementGenerateAppForLinkFunction::OnFaviconForApp, this), |
| 921 &cancelable_task_tracker_); | 919 &cancelable_task_tracker_); |
| 922 | 920 |
| 923 // Matched with a Release() in OnExtensionLoaded(). | 921 // Matched with a Release() in OnExtensionLoaded(). |
| 924 AddRef(); | 922 AddRef(); |
| 925 | 923 |
| 926 // Response is sent async in OnExtensionLoaded(). | 924 // Response is sent async in OnExtensionLoaded(). |
| 927 return true; | 925 return true; |
| 928 } | 926 } |
| 929 | 927 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 ManagementAPI::GetFactoryInstance() { | 998 ManagementAPI::GetFactoryInstance() { |
| 1001 return g_factory.Pointer(); | 999 return g_factory.Pointer(); |
| 1002 } | 1000 } |
| 1003 | 1001 |
| 1004 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { | 1002 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { |
| 1005 management_event_router_.reset(new ManagementEventRouter(browser_context_)); | 1003 management_event_router_.reset(new ManagementEventRouter(browser_context_)); |
| 1006 EventRouter::Get(browser_context_)->UnregisterObserver(this); | 1004 EventRouter::Get(browser_context_)->UnregisterObserver(this); |
| 1007 } | 1005 } |
| 1008 | 1006 |
| 1009 } // namespace extensions | 1007 } // namespace extensions |
| OLD | NEW |