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

Side by Side Diff: chrome/browser/devtools/devtools_window.h

Issue 225973003: DevTools: Forward whitelisted unhandled shortcuts from inspected page into DevTools frontend (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments from tsepez@ Created 6 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 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_
6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ 6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 19 matching lines...) Expand all
30 class Profile; 30 class Profile;
31 31
32 namespace base { 32 namespace base {
33 class Value; 33 class Value;
34 } 34 }
35 35
36 namespace content { 36 namespace content {
37 class DevToolsAgentHost; 37 class DevToolsAgentHost;
38 class DevToolsClientHost; 38 class DevToolsClientHost;
39 struct FileChooserParams; 39 struct FileChooserParams;
40 struct NativeWebKeyboardEvent;
40 class RenderViewHost; 41 class RenderViewHost;
41 class WebContents; 42 class WebContents;
42 } 43 }
43 44
44 namespace IPC { 45 namespace IPC {
45 class Message; 46 class Message;
46 } 47 }
47 48
48 namespace user_prefs { 49 namespace user_prefs {
49 class PrefRegistrySyncable; 50 class PrefRegistrySyncable;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 const DevToolsContentsResizingStrategy& GetContentsResizingStrategy() const; 127 const DevToolsContentsResizingStrategy& GetContentsResizingStrategy() const;
127 128
128 // Minimum size of the docked DevTools WebContents. This includes 129 // Minimum size of the docked DevTools WebContents. This includes
129 // the overlaying inspected WebContents size. 130 // the overlaying inspected WebContents size.
130 gfx::Size GetMinimumSize() const; 131 gfx::Size GetMinimumSize() const;
131 132
132 // Sets closure to be called after load is done. If already loaded, calls 133 // Sets closure to be called after load is done. If already loaded, calls
133 // closure immediately. 134 // closure immediately.
134 void SetLoadCompletedCallback(const base::Closure& closure); 135 void SetLoadCompletedCallback(const base::Closure& closure);
135 136
137 // Forwards an unhandled keyboard event to the DevTools frontend.
138 bool ForwardKeyboardEvent(const content::NativeWebKeyboardEvent& event);
139
136 // BeforeUnload interception //////////////////////////////////////////////// 140 // BeforeUnload interception ////////////////////////////////////////////////
137 141
138 // In order to preserve any edits the user may have made in devtools, the 142 // In order to preserve any edits the user may have made in devtools, the
139 // beforeunload event of the inspected page is hooked - devtools gets the 143 // beforeunload event of the inspected page is hooked - devtools gets the
140 // first shot at handling beforeunload and presents a dialog to the user. If 144 // first shot at handling beforeunload and presents a dialog to the user. If
141 // the user accepts the dialog then the script is given a chance to handle 145 // the user accepts the dialog then the script is given a chance to handle
142 // it. This way 2 dialogs may be displayed: one from the devtools asking the 146 // it. This way 2 dialogs may be displayed: one from the devtools asking the
143 // user to confirm that they're ok with their devtools edits going away and 147 // user to confirm that they're ok with their devtools edits going away and
144 // another from the webpage as the result of its beforeunload handler. 148 // another from the webpage as the result of its beforeunload handler.
145 // The following set of methods handle beforeunload event flow through 149 // The following set of methods handle beforeunload event flow through
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 virtual void AddFileSystem() OVERRIDE; 323 virtual void AddFileSystem() OVERRIDE;
320 virtual void RemoveFileSystem(const std::string& file_system_path) OVERRIDE; 324 virtual void RemoveFileSystem(const std::string& file_system_path) OVERRIDE;
321 virtual void UpgradeDraggedFileSystemPermissions( 325 virtual void UpgradeDraggedFileSystemPermissions(
322 const std::string& file_system_url) OVERRIDE; 326 const std::string& file_system_url) OVERRIDE;
323 virtual void IndexPath(int request_id, 327 virtual void IndexPath(int request_id,
324 const std::string& file_system_path) OVERRIDE; 328 const std::string& file_system_path) OVERRIDE;
325 virtual void StopIndexing(int request_id) OVERRIDE; 329 virtual void StopIndexing(int request_id) OVERRIDE;
326 virtual void SearchInPath(int request_id, 330 virtual void SearchInPath(int request_id,
327 const std::string& file_system_path, 331 const std::string& file_system_path,
328 const std::string& query) OVERRIDE; 332 const std::string& query) OVERRIDE;
333 virtual void SetWhitelistedShortcuts(const std::string& message) OVERRIDE;
329 virtual void ZoomIn() OVERRIDE; 334 virtual void ZoomIn() OVERRIDE;
330 virtual void ZoomOut() OVERRIDE; 335 virtual void ZoomOut() OVERRIDE;
331 virtual void ResetZoom() OVERRIDE; 336 virtual void ResetZoom() OVERRIDE;
332 337
333 // DevToolsFileHelper callbacks. 338 // DevToolsFileHelper callbacks.
334 void FileSavedAs(const std::string& url); 339 void FileSavedAs(const std::string& url);
335 void CanceledFileSaveAs(const std::string& url); 340 void CanceledFileSaveAs(const std::string& url);
336 void AppendedTo(const std::string& url); 341 void AppendedTo(const std::string& url);
337 void FileSystemsLoaded( 342 void FileSystemsLoaded(
338 const std::vector<DevToolsFileHelper::FileSystem>& file_systems); 343 const std::vector<DevToolsFileHelper::FileSystem>& file_systems);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 typedef std::map< 393 typedef std::map<
389 int, 394 int,
390 scoped_refptr<DevToolsFileSystemIndexer::FileSystemIndexingJob> > 395 scoped_refptr<DevToolsFileSystemIndexer::FileSystemIndexingJob> >
391 IndexingJobsMap; 396 IndexingJobsMap;
392 IndexingJobsMap indexing_jobs_; 397 IndexingJobsMap indexing_jobs_;
393 DevToolsContentsResizingStrategy contents_resizing_strategy_; 398 DevToolsContentsResizingStrategy contents_resizing_strategy_;
394 // True if we're in the process of handling a beforeunload event originating 399 // True if we're in the process of handling a beforeunload event originating
395 // from the inspected webcontents, see InterceptPageBeforeUnload for details. 400 // from the inspected webcontents, see InterceptPageBeforeUnload for details.
396 bool intercepted_page_beforeunload_; 401 bool intercepted_page_beforeunload_;
397 base::Closure load_completed_callback_; 402 base::Closure load_completed_callback_;
403 std::vector<int> whitelisted_keys_;
398 404
399 scoped_ptr<DevToolsEmbedderMessageDispatcher> embedder_message_dispatcher_; 405 scoped_ptr<DevToolsEmbedderMessageDispatcher> embedder_message_dispatcher_;
400 base::WeakPtrFactory<DevToolsWindow> weak_factory_; 406 base::WeakPtrFactory<DevToolsWindow> weak_factory_;
401 base::TimeTicks inspect_element_start_time_; 407 base::TimeTicks inspect_element_start_time_;
402 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); 408 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow);
403 }; 409 };
404 410
405 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ 411 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698