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/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 }; | 137 }; |
138 | 138 |
139 void IdleTest::SetUp() { | 139 void IdleTest::SetUp() { |
140 BrowserWithTestWindowTest::SetUp(); | 140 BrowserWithTestWindowTest::SetUp(); |
141 | 141 |
142 IdleManagerFactory::GetInstance()->SetTestingFactory(browser()->profile(), | 142 IdleManagerFactory::GetInstance()->SetTestingFactory(browser()->profile(), |
143 &IdleManagerTestFactory); | 143 &IdleManagerTestFactory); |
144 idle_manager_ = IdleManagerFactory::GetForProfile(browser()->profile()); | 144 idle_manager_ = IdleManagerFactory::GetForProfile(browser()->profile()); |
145 | 145 |
146 extension_ = utils::CreateEmptyExtensionWithLocation( | 146 extension_ = utils::CreateEmptyExtensionWithLocation( |
147 extensions::Extension::LOAD); | 147 extensions::Manifest::LOAD); |
148 | 148 |
149 idle_provider_ = new TestIdleProvider(); | 149 idle_provider_ = new TestIdleProvider(); |
150 idle_manager_->SetIdleTimeProviderForTest( | 150 idle_manager_->SetIdleTimeProviderForTest( |
151 scoped_ptr<IdleManager::IdleTimeProvider>(idle_provider_).Pass()); | 151 scoped_ptr<IdleManager::IdleTimeProvider>(idle_provider_).Pass()); |
152 event_delegate_ = new testing::StrictMock<MockEventDelegate>(); | 152 event_delegate_ = new testing::StrictMock<MockEventDelegate>(); |
153 idle_manager_->SetEventDelegateForTest( | 153 idle_manager_->SetEventDelegateForTest( |
154 scoped_ptr<IdleManager::EventDelegate>(event_delegate_).Pass()); | 154 scoped_ptr<IdleManager::EventDelegate>(event_delegate_).Pass()); |
155 idle_manager_->Init(); | 155 idle_manager_->Init(); |
156 } | 156 } |
157 | 157 |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 ScopedListen listen(idle_manager_, extension_->id()); | 554 ScopedListen listen(idle_manager_, extension_->id()); |
555 UnloadedExtensionInfo details(extension_, | 555 UnloadedExtensionInfo details(extension_, |
556 extension_misc::UNLOAD_REASON_UNINSTALL); | 556 extension_misc::UNLOAD_REASON_UNINSTALL); |
557 idle_manager_->Observe( | 557 idle_manager_->Observe( |
558 chrome::NOTIFICATION_EXTENSION_UNLOADED, | 558 chrome::NOTIFICATION_EXTENSION_UNLOADED, |
559 content::Source<Profile>(browser()->profile()), | 559 content::Source<Profile>(browser()->profile()), |
560 content::Details<UnloadedExtensionInfo>(&details)); | 560 content::Details<UnloadedExtensionInfo>(&details)); |
561 } | 561 } |
562 | 562 |
563 } // extensions | 563 } // extensions |
OLD | NEW |