Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(666)

Side by Side Diff: chrome/browser/extensions/api/idle/idle_api_unittest.cc

Issue 14141006: [components] Switch {RefCounted}ProfileKeyedService to use BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for review Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698