| 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 // Implements the Chrome Extensions Cookies API. | 5 // Implements the Chrome Extensions Cookies API. |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/api/cookies/cookies_api.h" | 7 #include "chrome/browser/extensions/api/cookies/cookies_api.h" |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/json/json_writer.h" | 12 #include "base/json/json_writer.h" |
| 13 #include "base/lazy_instance.h" | 13 #include "base/lazy_instance.h" |
| 14 #include "base/memory/linked_ptr.h" | 14 #include "base/memory/linked_ptr.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/profiler/scoped_profile.h" | |
| 17 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 18 #include "base/values.h" | 17 #include "base/values.h" |
| 19 #include "chrome/browser/chrome_notification_types.h" | 18 #include "chrome/browser/chrome_notification_types.h" |
| 20 #include "chrome/browser/extensions/api/cookies/cookies_api_constants.h" | 19 #include "chrome/browser/extensions/api/cookies/cookies_api_constants.h" |
| 21 #include "chrome/browser/extensions/api/cookies/cookies_helpers.h" | 20 #include "chrome/browser/extensions/api/cookies/cookies_helpers.h" |
| 22 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
| 23 #include "chrome/browser/ui/browser.h" | 22 #include "chrome/browser/ui/browser.h" |
| 24 #include "chrome/browser/ui/browser_iterator.h" | 23 #include "chrome/browser/ui/browser_iterator.h" |
| 25 #include "chrome/common/extensions/api/cookies.h" | 24 #include "chrome/common/extensions/api/cookies.h" |
| 26 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 static base::LazyInstance<BrowserContextKeyedAPIFactory<CookiesAPI> > | 573 static base::LazyInstance<BrowserContextKeyedAPIFactory<CookiesAPI> > |
| 575 g_factory = LAZY_INSTANCE_INITIALIZER; | 574 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 576 | 575 |
| 577 // static | 576 // static |
| 578 BrowserContextKeyedAPIFactory<CookiesAPI>* CookiesAPI::GetFactoryInstance() { | 577 BrowserContextKeyedAPIFactory<CookiesAPI>* CookiesAPI::GetFactoryInstance() { |
| 579 return g_factory.Pointer(); | 578 return g_factory.Pointer(); |
| 580 } | 579 } |
| 581 | 580 |
| 582 void CookiesAPI::OnListenerAdded( | 581 void CookiesAPI::OnListenerAdded( |
| 583 const extensions::EventListenerInfo& details) { | 582 const extensions::EventListenerInfo& details) { |
| 584 // TODO(vadimt): Remove ScopedProfile below once crbug.com/417106 is fixed. | |
| 585 tracked_objects::ScopedProfile tracking_profile( | |
| 586 FROM_HERE_WITH_EXPLICIT_FUNCTION("CookiesAPI::OnListenerAdded")); | |
| 587 | |
| 588 cookies_event_router_.reset(new CookiesEventRouter(browser_context_)); | 583 cookies_event_router_.reset(new CookiesEventRouter(browser_context_)); |
| 589 EventRouter::Get(browser_context_)->UnregisterObserver(this); | 584 EventRouter::Get(browser_context_)->UnregisterObserver(this); |
| 590 } | 585 } |
| 591 | 586 |
| 592 } // namespace extensions | 587 } // namespace extensions |
| OLD | NEW |