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/idle/idle_api.h" | 5 #include "chrome/browser/extensions/api/idle/idle_api.h" |
6 | 6 |
7 #include <limits.h> | 7 #include <limits.h> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 extension_id_); | 111 extension_id_); |
112 idle_manager_->OnListenerAdded(details); | 112 idle_manager_->OnListenerAdded(details); |
113 } | 113 } |
114 | 114 |
115 ScopedListen::~ScopedListen() { | 115 ScopedListen::~ScopedListen() { |
116 const EventListenerInfo details(idle_api_constants::kOnStateChanged, | 116 const EventListenerInfo details(idle_api_constants::kOnStateChanged, |
117 extension_id_); | 117 extension_id_); |
118 idle_manager_->OnListenerRemoved(details); | 118 idle_manager_->OnListenerRemoved(details); |
119 } | 119 } |
120 | 120 |
121 ProfileKeyedService* IdleManagerTestFactory(Profile* profile) { | 121 ProfileKeyedService* IdleManagerTestFactory(content::BrowserContext* profile) { |
122 return new IdleManager(profile); | 122 return new IdleManager(static_cast<Profile*>(profile)); |
123 } | 123 } |
124 | 124 |
125 } // namespace | 125 } // namespace |
126 | 126 |
127 class IdleTest : public BrowserWithTestWindowTest { | 127 class IdleTest : public BrowserWithTestWindowTest { |
128 public: | 128 public: |
129 virtual void SetUp() OVERRIDE; | 129 virtual void SetUp() OVERRIDE; |
130 | 130 |
131 protected: | 131 protected: |
132 base::Value* RunFunctionWithExtension( | 132 base::Value* RunFunctionWithExtension( |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 ScopedListen listen(idle_manager_, extension_->id()); | 556 ScopedListen listen(idle_manager_, extension_->id()); |
557 UnloadedExtensionInfo details(extension_, | 557 UnloadedExtensionInfo details(extension_, |
558 extension_misc::UNLOAD_REASON_UNINSTALL); | 558 extension_misc::UNLOAD_REASON_UNINSTALL); |
559 idle_manager_->Observe( | 559 idle_manager_->Observe( |
560 chrome::NOTIFICATION_EXTENSION_UNLOADED, | 560 chrome::NOTIFICATION_EXTENSION_UNLOADED, |
561 content::Source<Profile>(browser()->profile()), | 561 content::Source<Profile>(browser()->profile()), |
562 content::Details<UnloadedExtensionInfo>(&details)); | 562 content::Details<UnloadedExtensionInfo>(&details)); |
563 } | 563 } |
564 | 564 |
565 } // namespace extensions | 565 } // namespace extensions |
OLD | NEW |