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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 // content::DevToolsFrontendHostDelegate: | 115 // content::DevToolsFrontendHostDelegate: |
116 virtual void InspectedContentsClosing() OVERRIDE; | 116 virtual void InspectedContentsClosing() OVERRIDE; |
117 | 117 |
118 content::WebContents* web_contents() { return web_contents_; } | 118 content::WebContents* web_contents() { return web_contents_; } |
119 Browser* browser() { return browser_; } // For tests. | 119 Browser* browser() { return browser_; } // For tests. |
120 | 120 |
121 content::RenderViewHost* GetRenderViewHost(); | 121 content::RenderViewHost* GetRenderViewHost(); |
122 | 122 |
123 // Inspected WebContents is placed over DevTools WebContents in docked mode. | 123 // Inspected WebContents is placed over DevTools WebContents in docked mode. |
124 // The following methods return the insets of inspected WebContents | 124 // The following method returns the resizing strategy of inspected |
125 // relative to DevTools WebContents. | 125 // WebContents relative to DevTools WebContents. |
126 gfx::Insets GetContentsInsets() const; | 126 const DevToolsContentsResizingStrategy& GetContentsResizingStrategy() const; |
127 | 127 |
128 // Minimum size of the docked DevTools WebContents. This includes | 128 // Minimum size of the docked DevTools WebContents. This includes |
129 // the overlaying inspected WebContents size. | 129 // the overlaying inspected WebContents size. |
130 gfx::Size GetMinimumSize() const; | 130 gfx::Size GetMinimumSize() const; |
131 | 131 |
132 // BeforeUnload interception //////////////////////////////////////////////// | 132 // BeforeUnload interception //////////////////////////////////////////////// |
133 | 133 |
134 // In order to preserve any edits the user may have made in devtools, the | 134 // In order to preserve any edits the user may have made in devtools, the |
135 // beforeunload event of the inspected page is hooked - devtools gets the | 135 // beforeunload event of the inspected page is hooked - devtools gets the |
136 // first shot at handling beforeunload and presents a dialog to the user. If | 136 // 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... |
292 | 292 |
293 // content::DevToolsFrontendHostDelegate override: | 293 // content::DevToolsFrontendHostDelegate override: |
294 virtual void DispatchOnEmbedder(const std::string& message) OVERRIDE; | 294 virtual void DispatchOnEmbedder(const std::string& message) OVERRIDE; |
295 | 295 |
296 // DevToolsEmbedderMessageDispatcher::Delegate overrides: | 296 // DevToolsEmbedderMessageDispatcher::Delegate overrides: |
297 virtual void ActivateWindow() OVERRIDE; | 297 virtual void ActivateWindow() OVERRIDE; |
298 virtual void ActivateContents(content::WebContents* contents) OVERRIDE; | 298 virtual void ActivateContents(content::WebContents* contents) OVERRIDE; |
299 virtual void CloseWindow() OVERRIDE; | 299 virtual void CloseWindow() OVERRIDE; |
300 virtual void SetContentsInsets( | 300 virtual void SetContentsInsets( |
301 int left, int top, int right, int bottom) OVERRIDE; | 301 int left, int top, int right, int bottom) OVERRIDE; |
| 302 virtual void SetContentsResizingStrategy( |
| 303 const gfx::Insets& insets, const gfx::Size& min_size) OVERRIDE; |
302 virtual void InspectElementCompleted() OVERRIDE; | 304 virtual void InspectElementCompleted() OVERRIDE; |
303 virtual void MoveWindow(int x, int y) OVERRIDE; | 305 virtual void MoveWindow(int x, int y) OVERRIDE; |
304 virtual void SetIsDocked(bool is_docked) OVERRIDE; | 306 virtual void SetIsDocked(bool is_docked) OVERRIDE; |
305 virtual void OpenInNewTab(const std::string& url) OVERRIDE; | 307 virtual void OpenInNewTab(const std::string& url) OVERRIDE; |
306 virtual void SaveToFile(const std::string& url, | 308 virtual void SaveToFile(const std::string& url, |
307 const std::string& content, | 309 const std::string& content, |
308 bool save_as) OVERRIDE; | 310 bool save_as) OVERRIDE; |
309 virtual void AppendToFile(const std::string& url, | 311 virtual void AppendToFile(const std::string& url, |
310 const std::string& content) OVERRIDE; | 312 const std::string& content) OVERRIDE; |
311 virtual void RequestFileSystems() OVERRIDE; | 313 virtual void RequestFileSystems() OVERRIDE; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 bool ignore_set_is_docked_; | 375 bool ignore_set_is_docked_; |
374 content::NotificationRegistrar registrar_; | 376 content::NotificationRegistrar registrar_; |
375 scoped_ptr<content::DevToolsClientHost> frontend_host_; | 377 scoped_ptr<content::DevToolsClientHost> frontend_host_; |
376 scoped_ptr<DevToolsFileHelper> file_helper_; | 378 scoped_ptr<DevToolsFileHelper> file_helper_; |
377 scoped_refptr<DevToolsFileSystemIndexer> file_system_indexer_; | 379 scoped_refptr<DevToolsFileSystemIndexer> file_system_indexer_; |
378 typedef std::map< | 380 typedef std::map< |
379 int, | 381 int, |
380 scoped_refptr<DevToolsFileSystemIndexer::FileSystemIndexingJob> > | 382 scoped_refptr<DevToolsFileSystemIndexer::FileSystemIndexingJob> > |
381 IndexingJobsMap; | 383 IndexingJobsMap; |
382 IndexingJobsMap indexing_jobs_; | 384 IndexingJobsMap indexing_jobs_; |
383 gfx::Insets contents_insets_; | 385 DevToolsContentsResizingStrategy contents_resizing_strategy_; |
384 // True if we're in the process of handling a beforeunload event originating | 386 // True if we're in the process of handling a beforeunload event originating |
385 // from the inspected webcontents, see InterceptPageBeforeUnload for details. | 387 // from the inspected webcontents, see InterceptPageBeforeUnload for details. |
386 bool intercepted_page_beforeunload_; | 388 bool intercepted_page_beforeunload_; |
387 | 389 |
388 scoped_ptr<DevToolsEmbedderMessageDispatcher> embedder_message_dispatcher_; | 390 scoped_ptr<DevToolsEmbedderMessageDispatcher> embedder_message_dispatcher_; |
389 base::WeakPtrFactory<DevToolsWindow> weak_factory_; | 391 base::WeakPtrFactory<DevToolsWindow> weak_factory_; |
390 base::TimeTicks inspect_element_start_time_; | 392 base::TimeTicks inspect_element_start_time_; |
391 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); | 393 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); |
392 }; | 394 }; |
393 | 395 |
394 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ | 396 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ |
OLD | NEW |