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

Side by Side Diff: chrome/browser/renderer_host/render_process_host.h

Issue 160494: Disable input events when a JS dialog is showing. (Closed)
Patch Set: beforeunload Created 11 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/renderer_host/render_process_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_
6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 IPC::Channel::Listener* GetListenerByID(int routing_id) { 93 IPC::Channel::Listener* GetListenerByID(int routing_id) {
94 return listeners_.Lookup(routing_id); 94 return listeners_.Lookup(routing_id);
95 } 95 }
96 96
97 // Called to inform the render process host of a new "max page id" for a 97 // Called to inform the render process host of a new "max page id" for a
98 // render view host. The render process host computes the largest page id 98 // render view host. The render process host computes the largest page id
99 // across all render view hosts and uses the value when it needs to 99 // across all render view hosts and uses the value when it needs to
100 // initialize a new renderer in place of the current one. 100 // initialize a new renderer in place of the current one.
101 void UpdateMaxPageID(int32 page_id); 101 void UpdateMaxPageID(int32 page_id);
102 102
103 void set_ignore_input_events(bool ignore_input_events) {
104 ignore_input_events_ = ignore_input_events;
105 }
106 bool ignore_input_events() {
107 return ignore_input_events_;
108 }
109
103 // Virtual interface --------------------------------------------------------- 110 // Virtual interface ---------------------------------------------------------
104 111
105 // Initialize the new renderer process, returning true on success. This must 112 // Initialize the new renderer process, returning true on success. This must
106 // be called once before the object can be used, but can be called after 113 // be called once before the object can be used, but can be called after
107 // that with no effect. Therefore, if the caller isn't sure about whether 114 // that with no effect. Therefore, if the caller isn't sure about whether
108 // the process has been created, it should just call Init(). 115 // the process has been created, it should just call Init().
109 virtual bool Init() = 0; 116 virtual bool Init() = 0;
110 117
111 // Gets the next available routing id. 118 // Gets the next available routing id.
112 virtual int GetNextRoutingID() = 0; 119 virtual int GetNextRoutingID() = 0;
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 std::set<int> listeners_expecting_close_; 242 std::set<int> listeners_expecting_close_;
236 243
237 // True if the process can be shut down suddenly. If this is true, then we're 244 // True if the process can be shut down suddenly. If this is true, then we're
238 // sure that all the RenderViews in the process can be shutdown suddenly. If 245 // sure that all the RenderViews in the process can be shutdown suddenly. If
239 // it's false, then specific RenderViews might still be allowed to be shutdown 246 // it's false, then specific RenderViews might still be allowed to be shutdown
240 // suddenly by checking their SuddenTerminationAllowed() flag. This can occur 247 // suddenly by checking their SuddenTerminationAllowed() flag. This can occur
241 // if one tab has an unload event listener but another tab in the same process 248 // if one tab has an unload event listener but another tab in the same process
242 // doesn't. 249 // doesn't.
243 bool sudden_termination_allowed_; 250 bool sudden_termination_allowed_;
244 251
252 // Set to true if we shouldn't send input events. We actually do the
253 // filtering for this at the render widget level.
254 bool ignore_input_events_;
255
245 // See getter above. 256 // See getter above.
246 static bool run_renderer_in_process_; 257 static bool run_renderer_in_process_;
247 258
248 DISALLOW_COPY_AND_ASSIGN(RenderProcessHost); 259 DISALLOW_COPY_AND_ASSIGN(RenderProcessHost);
249 }; 260 };
250 261
251 // Factory object for RenderProcessHosts. Using this factory allows tests to 262 // Factory object for RenderProcessHosts. Using this factory allows tests to
252 // swap out a different one to use a TestRenderProcessHost. 263 // swap out a different one to use a TestRenderProcessHost.
253 class RenderProcessHostFactory { 264 class RenderProcessHostFactory {
254 public: 265 public:
255 virtual ~RenderProcessHostFactory() {} 266 virtual ~RenderProcessHostFactory() {}
256 virtual RenderProcessHost* CreateRenderProcessHost( 267 virtual RenderProcessHost* CreateRenderProcessHost(
257 Profile* profile) const = 0; 268 Profile* profile) const = 0;
258 }; 269 };
259 270
260 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ 271 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/renderer_host/render_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698