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

Side by Side Diff: chrome/browser/extensions/extension_idle_api.cc

Issue 5875005: Cleanup: Remove unneeded includes of notification_service.h.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: put includes in right order Created 10 years 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // This implementation supposes a single extension thread and synchronized 5 // This implementation supposes a single extension thread and synchronized
6 // method invokation. 6 // method invokation.
7 7
8 #include "chrome/browser/extensions/extension_idle_api.h" 8 #include "chrome/browser/extensions/extension_idle_api.h"
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "base/json/json_writer.h" 12 #include "base/json/json_writer.h"
13 #include "base/message_loop.h" 13 #include "base/message_loop.h"
14 #include "base/stl_util-inl.h" 14 #include "base/stl_util-inl.h"
15 #include "base/task.h" 15 #include "base/task.h"
16 #include "base/time.h" 16 #include "base/time.h"
17 #include "chrome/browser/extensions/extension_event_router.h" 17 #include "chrome/browser/extensions/extension_event_router.h"
18 #include "chrome/browser/extensions/extension_host.h" 18 #include "chrome/browser/extensions/extension_host.h"
19 #include "chrome/browser/extensions/extension_idle_api_constants.h" 19 #include "chrome/browser/extensions/extension_idle_api_constants.h"
20 #include "chrome/browser/extensions/extension_service.h" 20 #include "chrome/browser/extensions/extension_service.h"
21 #include "chrome/browser/profiles/profile.h" 21 #include "chrome/browser/profiles/profile.h"
22 #include "chrome/browser/renderer_host/render_view_host.h" 22 #include "chrome/browser/renderer_host/render_view_host.h"
23 #include "chrome/browser/ui/browser.h" 23 #include "chrome/browser/ui/browser.h"
24 #include "chrome/common/extensions/extension.h" 24 #include "chrome/common/extensions/extension.h"
25 #include "chrome/common/notification_service.h"
26 25
27 namespace keys = extension_idle_api_constants; 26 namespace keys = extension_idle_api_constants;
28 27
29 namespace { 28 namespace {
30 29
31 const int kIdlePollInterval = 15; // Number of seconds between status checks 30 const int kIdlePollInterval = 15; // Number of seconds between status checks
32 // when polling for active. 31 // when polling for active.
33 const int kMinThreshold = 15; // In seconds. Set >1 sec for security concerns. 32 const int kMinThreshold = 15; // In seconds. Set >1 sec for security concerns.
34 const int kMaxThreshold = 60*60; // One hours, in seconds. Not set arbitrarily 33 const int kMaxThreshold = 60*60; // One hours, in seconds. Not set arbitrarily
35 // high for security concerns. 34 // high for security concerns.
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 IdleState state) { 148 IdleState state) {
150 // Prepare the single argument of the current state. 149 // Prepare the single argument of the current state.
151 ListValue args; 150 ListValue args;
152 args.Append(CreateIdleValue(state)); 151 args.Append(CreateIdleValue(state));
153 std::string json_args; 152 std::string json_args;
154 base::JSONWriter::Write(&args, false, &json_args); 153 base::JSONWriter::Write(&args, false, &json_args);
155 154
156 profile->GetExtensionEventRouter()->DispatchEventToRenderers( 155 profile->GetExtensionEventRouter()->DispatchEventToRenderers(
157 keys::kOnStateChanged, json_args, profile, GURL()); 156 keys::kOnStateChanged, json_args, profile, GURL());
158 } 157 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_disabled_infobar_delegate.cc ('k') | chrome/browser/extensions/extension_processes_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698