OLD | NEW |
---|---|
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 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
15 #include "chrome/browser/devtools/devtools_contents_resizing_strategy.h" | |
15 #include "chrome/browser/devtools/devtools_embedder_message_dispatcher.h" | 16 #include "chrome/browser/devtools/devtools_embedder_message_dispatcher.h" |
16 #include "chrome/browser/devtools/devtools_file_helper.h" | 17 #include "chrome/browser/devtools/devtools_file_helper.h" |
17 #include "chrome/browser/devtools/devtools_file_system_indexer.h" | 18 #include "chrome/browser/devtools/devtools_file_system_indexer.h" |
18 #include "chrome/browser/devtools/devtools_toggle_action.h" | 19 #include "chrome/browser/devtools/devtools_toggle_action.h" |
19 #include "content/public/browser/devtools_client_host.h" | 20 #include "content/public/browser/devtools_client_host.h" |
20 #include "content/public/browser/devtools_frontend_host_delegate.h" | 21 #include "content/public/browser/devtools_frontend_host_delegate.h" |
21 #include "content/public/browser/notification_observer.h" | 22 #include "content/public/browser/notification_observer.h" |
22 #include "content/public/browser/notification_registrar.h" | 23 #include "content/public/browser/notification_registrar.h" |
23 #include "content/public/browser/web_contents_delegate.h" | 24 #include "content/public/browser/web_contents_delegate.h" |
24 #include "ui/gfx/insets.h" | |
25 #include "ui/gfx/size.h" | 25 #include "ui/gfx/size.h" |
26 | 26 |
27 class Browser; | 27 class Browser; |
28 class BrowserWindow; | 28 class BrowserWindow; |
29 class DevToolsControllerTest; | 29 class DevToolsControllerTest; |
30 class Profile; | 30 class Profile; |
31 | 31 |
32 namespace base { | 32 namespace base { |
33 class Value; | 33 class Value; |
34 } | 34 } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 | 116 |
117 // content::DevToolsFrontendHostDelegate: | 117 // content::DevToolsFrontendHostDelegate: |
118 virtual void InspectedContentsClosing() OVERRIDE; | 118 virtual void InspectedContentsClosing() OVERRIDE; |
119 | 119 |
120 content::WebContents* web_contents() { return web_contents_; } | 120 content::WebContents* web_contents() { return web_contents_; } |
121 Browser* browser() { return browser_; } // For tests. | 121 Browser* browser() { return browser_; } // For tests. |
122 | 122 |
123 content::RenderViewHost* GetRenderViewHost(); | 123 content::RenderViewHost* GetRenderViewHost(); |
124 | 124 |
125 // Inspected WebContents is placed over DevTools WebContents in docked mode. | 125 // Inspected WebContents is placed over DevTools WebContents in docked mode. |
126 // The following methods return the insets of inspected WebContents | 126 // The The following method returns the resizing strategy of inspected |
pfeldman
2014/01/31 15:08:28
The The -> The
dgozman
2014/02/01 13:21:35
Done.
| |
127 // relative to DevTools WebContents. | 127 // WebContents relative to DevTools WebContents. |
128 gfx::Insets GetContentsInsets() const; | 128 const DevToolsContentsResizingStrategy& GetContentsResizingStrategy() const; |
129 | 129 |
130 // Minimum size of the docked DevTools WebContents. This includes | 130 // Minimum size of the docked DevTools WebContents. This includes |
131 // the overlaying inspected WebContents size. | 131 // the overlaying inspected WebContents size. |
132 gfx::Size GetMinimumSize() const; | 132 gfx::Size GetMinimumSize() const; |
133 | 133 |
134 // BeforeUnload interception //////////////////////////////////////////////// | 134 // BeforeUnload interception //////////////////////////////////////////////// |
135 | 135 |
136 // In order to preserve any edits the user may have made in devtools, the | 136 // In order to preserve any edits the user may have made in devtools, the |
137 // beforeunload event of the inspected page is hooked - devtools gets the | 137 // beforeunload event of the inspected page is hooked - devtools gets the |
138 // first shot at handling beforeunload and presents a dialog to the user. If | 138 // first shot at handling beforeunload and presents a dialog to the user. If |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
294 | 294 |
295 // content::DevToolsFrontendHostDelegate override: | 295 // content::DevToolsFrontendHostDelegate override: |
296 virtual void DispatchOnEmbedder(const std::string& message) OVERRIDE; | 296 virtual void DispatchOnEmbedder(const std::string& message) OVERRIDE; |
297 | 297 |
298 // DevToolsEmbedderMessageDispatcher::Delegate overrides: | 298 // DevToolsEmbedderMessageDispatcher::Delegate overrides: |
299 virtual void ActivateWindow() OVERRIDE; | 299 virtual void ActivateWindow() OVERRIDE; |
300 virtual void ActivateContents(content::WebContents* contents) OVERRIDE; | 300 virtual void ActivateContents(content::WebContents* contents) OVERRIDE; |
301 virtual void CloseWindow() OVERRIDE; | 301 virtual void CloseWindow() OVERRIDE; |
302 virtual void SetContentsInsets( | 302 virtual void SetContentsInsets( |
303 int left, int top, int right, int bottom) OVERRIDE; | 303 int left, int top, int right, int bottom) OVERRIDE; |
304 virtual void SetContentsResizingStrategy( | |
305 const gfx::Insets& insets, const gfx::Size& min_size) OVERRIDE; | |
304 virtual void InspectElementCompleted() OVERRIDE; | 306 virtual void InspectElementCompleted() OVERRIDE; |
305 virtual void MoveWindow(int x, int y) OVERRIDE; | 307 virtual void MoveWindow(int x, int y) OVERRIDE; |
306 virtual void SetIsDocked(bool is_docked) OVERRIDE; | 308 virtual void SetIsDocked(bool is_docked) OVERRIDE; |
307 virtual void OpenInNewTab(const std::string& url) OVERRIDE; | 309 virtual void OpenInNewTab(const std::string& url) OVERRIDE; |
308 virtual void SaveToFile(const std::string& url, | 310 virtual void SaveToFile(const std::string& url, |
309 const std::string& content, | 311 const std::string& content, |
310 bool save_as) OVERRIDE; | 312 bool save_as) OVERRIDE; |
311 virtual void AppendToFile(const std::string& url, | 313 virtual void AppendToFile(const std::string& url, |
312 const std::string& content) OVERRIDE; | 314 const std::string& content) OVERRIDE; |
313 virtual void RequestFileSystems() OVERRIDE; | 315 virtual void RequestFileSystems() OVERRIDE; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
375 bool ignore_set_is_docked_; | 377 bool ignore_set_is_docked_; |
376 content::NotificationRegistrar registrar_; | 378 content::NotificationRegistrar registrar_; |
377 scoped_ptr<content::DevToolsClientHost> frontend_host_; | 379 scoped_ptr<content::DevToolsClientHost> frontend_host_; |
378 scoped_ptr<DevToolsFileHelper> file_helper_; | 380 scoped_ptr<DevToolsFileHelper> file_helper_; |
379 scoped_refptr<DevToolsFileSystemIndexer> file_system_indexer_; | 381 scoped_refptr<DevToolsFileSystemIndexer> file_system_indexer_; |
380 typedef std::map< | 382 typedef std::map< |
381 int, | 383 int, |
382 scoped_refptr<DevToolsFileSystemIndexer::FileSystemIndexingJob> > | 384 scoped_refptr<DevToolsFileSystemIndexer::FileSystemIndexingJob> > |
383 IndexingJobsMap; | 385 IndexingJobsMap; |
384 IndexingJobsMap indexing_jobs_; | 386 IndexingJobsMap indexing_jobs_; |
385 gfx::Insets contents_insets_; | 387 DevToolsContentsResizingStrategy contents_resizing_strategy_; |
386 // True if we're in the process of handling a beforeunload event originating | 388 // True if we're in the process of handling a beforeunload event originating |
387 // from the inspected webcontents, see InterceptPageBeforeUnload for details. | 389 // from the inspected webcontents, see InterceptPageBeforeUnload for details. |
388 bool intercepted_page_beforeunload_; | 390 bool intercepted_page_beforeunload_; |
389 | 391 |
390 scoped_ptr<DevToolsEmbedderMessageDispatcher> embedder_message_dispatcher_; | 392 scoped_ptr<DevToolsEmbedderMessageDispatcher> embedder_message_dispatcher_; |
391 base::WeakPtrFactory<DevToolsWindow> weak_factory_; | 393 base::WeakPtrFactory<DevToolsWindow> weak_factory_; |
392 base::TimeTicks inspect_element_start_time_; | 394 base::TimeTicks inspect_element_start_time_; |
393 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); | 395 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); |
394 }; | 396 }; |
395 | 397 |
396 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ | 398 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ |
OLD | NEW |