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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 #include "googleurl/src/gurl.h" | 71 #include "googleurl/src/gurl.h" |
72 #include "net/base/registry_controlled_domain.h" | 72 #include "net/base/registry_controlled_domain.h" |
73 #include "webkit/database/database_tracker.h" | 73 #include "webkit/database/database_tracker.h" |
74 #include "webkit/database/database_util.h" | 74 #include "webkit/database/database_util.h" |
75 #include "webkit/plugins/npapi/plugin_list.h" | 75 #include "webkit/plugins/npapi/plugin_list.h" |
76 | 76 |
77 #if defined(OS_CHROMEOS) | 77 #if defined(OS_CHROMEOS) |
78 #include "chrome/browser/chromeos/extensions/file_browser_event_router.h" | 78 #include "chrome/browser/chromeos/extensions/file_browser_event_router.h" |
79 #endif | 79 #endif |
80 | 80 |
| 81 #if defined(TOUCH_UI) |
| 82 #include "chrome/browser/extensions/extension_ime_ui_api.h" |
| 83 #endif |
| 84 |
81 using base::Time; | 85 using base::Time; |
82 | 86 |
83 namespace errors = extension_manifest_errors; | 87 namespace errors = extension_manifest_errors; |
84 | 88 |
85 namespace { | 89 namespace { |
86 | 90 |
87 #if defined(OS_LINUX) | 91 #if defined(OS_LINUX) |
88 static const int kOmniboxIconPaddingLeft = 2; | 92 static const int kOmniboxIconPaddingLeft = 2; |
89 static const int kOmniboxIconPaddingRight = 2; | 93 static const int kOmniboxIconPaddingRight = 2; |
90 #elif defined(OS_MACOSX) | 94 #elif defined(OS_MACOSX) |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 ExtensionAccessibilityEventRouter::GetInstance()->ObserveProfile(profile_); | 504 ExtensionAccessibilityEventRouter::GetInstance()->ObserveProfile(profile_); |
501 browser_event_router_.reset(new ExtensionBrowserEventRouter(profile_)); | 505 browser_event_router_.reset(new ExtensionBrowserEventRouter(profile_)); |
502 browser_event_router_->Init(); | 506 browser_event_router_->Init(); |
503 preference_event_router_.reset(new ExtensionPreferenceEventRouter(profile_)); | 507 preference_event_router_.reset(new ExtensionPreferenceEventRouter(profile_)); |
504 ExtensionBookmarkEventRouter::GetInstance()->Observe( | 508 ExtensionBookmarkEventRouter::GetInstance()->Observe( |
505 profile_->GetBookmarkModel()); | 509 profile_->GetBookmarkModel()); |
506 ExtensionCookiesEventRouter::GetInstance()->Init(); | 510 ExtensionCookiesEventRouter::GetInstance()->Init(); |
507 ExtensionManagementEventRouter::GetInstance()->Init(); | 511 ExtensionManagementEventRouter::GetInstance()->Init(); |
508 ExtensionProcessesEventRouter::GetInstance()->ObserveProfile(profile_); | 512 ExtensionProcessesEventRouter::GetInstance()->ObserveProfile(profile_); |
509 ExtensionWebNavigationEventRouter::GetInstance()->Init(); | 513 ExtensionWebNavigationEventRouter::GetInstance()->Init(); |
| 514 |
510 #if defined(OS_CHROMEOS) | 515 #if defined(OS_CHROMEOS) |
511 ExtensionFileBrowserEventRouter::GetInstance()->ObserveFileSystemEvents( | 516 ExtensionFileBrowserEventRouter::GetInstance()->ObserveFileSystemEvents( |
512 profile_); | 517 profile_); |
513 #endif | 518 #endif |
| 519 |
| 520 #if defined(OS_CHROMEOS) && defined(TOUCH_UI) |
| 521 ExtensionImeUiEventRouter::GetInstance()->Init(); |
| 522 #endif |
| 523 |
514 event_routers_initialized_ = true; | 524 event_routers_initialized_ = true; |
515 } | 525 } |
516 | 526 |
517 const Extension* ExtensionService::GetExtensionById( | 527 const Extension* ExtensionService::GetExtensionById( |
518 const std::string& id, bool include_disabled) const { | 528 const std::string& id, bool include_disabled) const { |
519 return GetExtensionByIdInternal(id, true, include_disabled); | 529 return GetExtensionByIdInternal(id, true, include_disabled); |
520 } | 530 } |
521 | 531 |
522 void ExtensionService::Init() { | 532 void ExtensionService::Init() { |
523 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 533 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1907 } | 1917 } |
1908 | 1918 |
1909 void ExtensionService::SetBeingUpgraded(const Extension* extension, | 1919 void ExtensionService::SetBeingUpgraded(const Extension* extension, |
1910 bool value) { | 1920 bool value) { |
1911 extension_runtime_data_[extension->id()].being_upgraded = value; | 1921 extension_runtime_data_[extension->id()].being_upgraded = value; |
1912 } | 1922 } |
1913 | 1923 |
1914 PropertyBag* ExtensionService::GetPropertyBag(const Extension* extension) { | 1924 PropertyBag* ExtensionService::GetPropertyBag(const Extension* extension) { |
1915 return &extension_runtime_data_[extension->id()].property_bag; | 1925 return &extension_runtime_data_[extension->id()].property_bag; |
1916 } | 1926 } |
OLD | NEW |