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

Unified Diff: chrome/renderer/navigation_state.h

Issue 339064: Add new user script injection point: document_idle. (Closed)
Patch Set: smaller, cleaner, better Created 11 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/navigation_state.h
diff --git a/chrome/renderer/navigation_state.h b/chrome/renderer/navigation_state.h
index 46031ddd1bedba54a58bb0092beb9201b58a20e4..394aee9e995b69dc3de43d18a947e80c3a912da2 100644
--- a/chrome/renderer/navigation_state.h
+++ b/chrome/renderer/navigation_state.h
@@ -8,6 +8,7 @@
#include "base/scoped_ptr.h"
#include "base/time.h"
#include "chrome/common/page_transition_types.h"
+#include "chrome/renderer/user_script_idle_scheduler.h"
#include "webkit/api/public/WebDataSource.h"
#include "webkit/glue/alt_error_page_resource_fetcher.h"
#include "webkit/glue/password_form.h"
@@ -33,6 +34,13 @@ class NavigationState : public WebKit::WebDataSource::ExtraData {
return static_cast<NavigationState*>(ds->extraData());
}
+ UserScriptIdleScheduler* user_script_idle_scheduler() {
Matt Perry 2009/11/02 19:46:30 Very clean. I like it.
+ return user_script_idle_scheduler_.get();
+ }
+ void set_user_script_idle_scheduler(UserScriptIdleScheduler* scheduler) {
+ user_script_idle_scheduler_.reset(scheduler);
+ }
+
// Contains the page_id for this navigation or -1 if there is none yet.
int32 pending_page_id() const { return pending_page_id_; }
@@ -173,7 +181,8 @@ class NavigationState : public WebKit::WebDataSource::ExtraData {
request_committed_(false),
is_content_initiated_(is_content_initiated),
pending_page_id_(pending_page_id),
- postpone_loading_data_(false) {
+ postpone_loading_data_(false),
+ user_script_idle_scheduler_(NULL) {
darin (slow to review) 2009/11/03 05:11:00 nit: no need to NULL out a scoped_ptr
}
PageTransition::Type transition_type_;
@@ -195,6 +204,7 @@ class NavigationState : public WebKit::WebDataSource::ExtraData {
std::string security_info_;
bool postpone_loading_data_;
std::string postponed_data_;
+ scoped_ptr<UserScriptIdleScheduler> user_script_idle_scheduler_;
DISALLOW_COPY_AND_ASSIGN(NavigationState);
};

Powered by Google App Engine
This is Rietveld 408576698