| 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_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 #include "webkit/database/database_util.h" | 82 #include "webkit/database/database_util.h" |
| 83 #include "webkit/plugins/npapi/plugin_list.h" | 83 #include "webkit/plugins/npapi/plugin_list.h" |
| 84 | 84 |
| 85 #if defined(OS_CHROMEOS) | 85 #if defined(OS_CHROMEOS) |
| 86 #include "chrome/browser/chromeos/extensions/file_browser_event_router.h" | 86 #include "chrome/browser/chromeos/extensions/file_browser_event_router.h" |
| 87 #include "webkit/fileapi/file_system_context.h" | 87 #include "webkit/fileapi/file_system_context.h" |
| 88 #include "webkit/fileapi/file_system_mount_point_provider.h" | 88 #include "webkit/fileapi/file_system_mount_point_provider.h" |
| 89 #include "webkit/fileapi/file_system_path_manager.h" | 89 #include "webkit/fileapi/file_system_path_manager.h" |
| 90 #endif | 90 #endif |
| 91 | 91 |
| 92 #if defined(OS_CHROMEOS) && defined(TOUCH_UI) |
| 93 #include "chrome/browser/extensions/extension_input_ui_api.h" |
| 94 #endif |
| 95 |
| 92 using base::Time; | 96 using base::Time; |
| 93 | 97 |
| 94 namespace errors = extension_manifest_errors; | 98 namespace errors = extension_manifest_errors; |
| 95 | 99 |
| 96 namespace { | 100 namespace { |
| 97 | 101 |
| 98 #if defined(OS_LINUX) | 102 #if defined(OS_LINUX) |
| 99 static const int kOmniboxIconPaddingLeft = 2; | 103 static const int kOmniboxIconPaddingLeft = 2; |
| 100 static const int kOmniboxIconPaddingRight = 2; | 104 static const int kOmniboxIconPaddingRight = 2; |
| 101 #elif defined(OS_MACOSX) | 105 #elif defined(OS_MACOSX) |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 ExtensionAccessibilityEventRouter::GetInstance()->ObserveProfile(profile_); | 537 ExtensionAccessibilityEventRouter::GetInstance()->ObserveProfile(profile_); |
| 534 browser_event_router_.reset(new ExtensionBrowserEventRouter(profile_)); | 538 browser_event_router_.reset(new ExtensionBrowserEventRouter(profile_)); |
| 535 browser_event_router_->Init(); | 539 browser_event_router_->Init(); |
| 536 preference_event_router_.reset(new ExtensionPreferenceEventRouter(profile_)); | 540 preference_event_router_.reset(new ExtensionPreferenceEventRouter(profile_)); |
| 537 ExtensionBookmarkEventRouter::GetInstance()->Observe( | 541 ExtensionBookmarkEventRouter::GetInstance()->Observe( |
| 538 profile_->GetBookmarkModel()); | 542 profile_->GetBookmarkModel()); |
| 539 ExtensionCookiesEventRouter::GetInstance()->Init(); | 543 ExtensionCookiesEventRouter::GetInstance()->Init(); |
| 540 ExtensionManagementEventRouter::GetInstance()->Init(); | 544 ExtensionManagementEventRouter::GetInstance()->Init(); |
| 541 ExtensionProcessesEventRouter::GetInstance()->ObserveProfile(profile_); | 545 ExtensionProcessesEventRouter::GetInstance()->ObserveProfile(profile_); |
| 542 ExtensionWebNavigationEventRouter::GetInstance()->Init(); | 546 ExtensionWebNavigationEventRouter::GetInstance()->Init(); |
| 547 |
| 543 #if defined(OS_CHROMEOS) | 548 #if defined(OS_CHROMEOS) |
| 544 ExtensionFileBrowserEventRouter::GetInstance()->ObserveFileSystemEvents( | 549 ExtensionFileBrowserEventRouter::GetInstance()->ObserveFileSystemEvents( |
| 545 profile_); | 550 profile_); |
| 546 #endif | 551 #endif |
| 552 |
| 553 #if defined(OS_CHROMEOS) && defined(TOUCH_UI) |
| 554 ExtensionInputUiEventRouter::GetInstance()->Init(); |
| 555 #endif |
| 556 |
| 547 event_routers_initialized_ = true; | 557 event_routers_initialized_ = true; |
| 548 } | 558 } |
| 549 | 559 |
| 550 const Extension* ExtensionService::GetExtensionById( | 560 const Extension* ExtensionService::GetExtensionById( |
| 551 const std::string& id, bool include_disabled) const { | 561 const std::string& id, bool include_disabled) const { |
| 552 return GetExtensionByIdInternal(id, true, include_disabled, false); | 562 return GetExtensionByIdInternal(id, true, include_disabled, false); |
| 553 } | 563 } |
| 554 | 564 |
| 555 void ExtensionService::Init() { | 565 void ExtensionService::Init() { |
| 556 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 566 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| (...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2197 | 2207 |
| 2198 ExtensionService::NaClModuleInfoList::iterator | 2208 ExtensionService::NaClModuleInfoList::iterator |
| 2199 ExtensionService::FindNaClModule(const GURL& url) { | 2209 ExtensionService::FindNaClModule(const GURL& url) { |
| 2200 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 2210 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
| 2201 iter != nacl_module_list_.end(); ++iter) { | 2211 iter != nacl_module_list_.end(); ++iter) { |
| 2202 if (iter->url == url) | 2212 if (iter->url == url) |
| 2203 return iter; | 2213 return iter; |
| 2204 } | 2214 } |
| 2205 return nacl_module_list_.end(); | 2215 return nacl_module_list_.end(); |
| 2206 } | 2216 } |
| OLD | NEW |