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_embedder_message_dispatcher.h" | 15 #include "chrome/browser/devtools/devtools_embedder_message_dispatcher.h" |
16 #include "chrome/browser/devtools/devtools_file_helper.h" | 16 #include "chrome/browser/devtools/devtools_file_helper.h" |
17 #include "chrome/browser/devtools/devtools_file_system_indexer.h" | 17 #include "chrome/browser/devtools/devtools_file_system_indexer.h" |
| 18 #include "chrome/browser/devtools/devtools_power_profiler_host.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 | 25 |
25 class Browser; | 26 class Browser; |
26 class BrowserWindow; | 27 class BrowserWindow; |
27 class DevToolsControllerTest; | 28 class DevToolsControllerTest; |
| 29 class DevToolsPowerProfilerHost; |
28 class Profile; | 30 class Profile; |
29 | 31 |
30 namespace base { | 32 namespace base { |
31 class Value; | 33 class Value; |
32 } | 34 } |
33 | 35 |
34 namespace content { | 36 namespace content { |
35 class DevToolsAgentHost; | 37 class DevToolsAgentHost; |
36 class DevToolsClientHost; | 38 class DevToolsClientHost; |
37 struct FileChooserParams; | 39 struct FileChooserParams; |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 virtual void AddFileSystem() OVERRIDE; | 294 virtual void AddFileSystem() OVERRIDE; |
293 virtual void RemoveFileSystem(const std::string& file_system_path) OVERRIDE; | 295 virtual void RemoveFileSystem(const std::string& file_system_path) OVERRIDE; |
294 virtual void UpgradeDraggedFileSystemPermissions( | 296 virtual void UpgradeDraggedFileSystemPermissions( |
295 const std::string& file_system_url) OVERRIDE; | 297 const std::string& file_system_url) OVERRIDE; |
296 virtual void IndexPath(int request_id, | 298 virtual void IndexPath(int request_id, |
297 const std::string& file_system_path) OVERRIDE; | 299 const std::string& file_system_path) OVERRIDE; |
298 virtual void StopIndexing(int request_id) OVERRIDE; | 300 virtual void StopIndexing(int request_id) OVERRIDE; |
299 virtual void SearchInPath(int request_id, | 301 virtual void SearchInPath(int request_id, |
300 const std::string& file_system_path, | 302 const std::string& file_system_path, |
301 const std::string& query) OVERRIDE; | 303 const std::string& query) OVERRIDE; |
| 304 virtual void QueryPowerProfilerServiceStatus() OVERRIDE; |
| 305 virtual void StartPowerProfiling() OVERRIDE; |
| 306 virtual void StopPowerProfiling() OVERRIDE; |
| 307 virtual void SetPowerProfilingResolution(unsigned) OVERRIDE; |
302 | 308 |
303 // DevToolsFileHelper callbacks. | 309 // DevToolsFileHelper callbacks. |
304 void FileSavedAs(const std::string& url); | 310 void FileSavedAs(const std::string& url); |
305 void CanceledFileSaveAs(const std::string& url); | 311 void CanceledFileSaveAs(const std::string& url); |
306 void AppendedTo(const std::string& url); | 312 void AppendedTo(const std::string& url); |
307 void FileSystemsLoaded( | 313 void FileSystemsLoaded( |
308 const std::vector<DevToolsFileHelper::FileSystem>& file_systems); | 314 const std::vector<DevToolsFileHelper::FileSystem>& file_systems); |
309 void FileSystemAdded(const DevToolsFileHelper::FileSystem& file_system); | 315 void FileSystemAdded(const DevToolsFileHelper::FileSystem& file_system); |
310 void IndexingTotalWorkCalculated(int request_id, | 316 void IndexingTotalWorkCalculated(int request_id, |
311 const std::string& file_system_path, | 317 const std::string& file_system_path, |
312 int total_work); | 318 int total_work); |
313 void IndexingWorked(int request_id, | 319 void IndexingWorked(int request_id, |
314 const std::string& file_system_path, | 320 const std::string& file_system_path, |
315 int worked); | 321 int worked); |
316 void IndexingDone(int request_id, const std::string& file_system_path); | 322 void IndexingDone(int request_id, const std::string& file_system_path); |
317 void SearchCompleted(int request_id, | 323 void SearchCompleted(int request_id, |
318 const std::string& file_system_path, | 324 const std::string& file_system_path, |
319 const std::vector<std::string>& file_paths); | 325 const std::vector<std::string>& file_paths); |
320 void ShowDevToolsConfirmInfoBar(const base::string16& message, | 326 void ShowDevToolsConfirmInfoBar(const base::string16& message, |
321 const InfoBarCallback& callback); | 327 const InfoBarCallback& callback); |
| 328 void SendPowerEvent(const std::string&); |
322 | 329 |
323 void CreateDevToolsBrowser(); | 330 void CreateDevToolsBrowser(); |
324 BrowserWindow* GetInspectedBrowserWindow(); | 331 BrowserWindow* GetInspectedBrowserWindow(); |
325 bool IsInspectedBrowserPopup(); | 332 bool IsInspectedBrowserPopup(); |
326 void UpdateFrontendDockSide(); | 333 void UpdateFrontendDockSide(); |
327 void ScheduleAction(const DevToolsToggleAction& action); | 334 void ScheduleAction(const DevToolsToggleAction& action); |
328 void DoAction(); | 335 void DoAction(); |
329 void UpdateTheme(); | 336 void UpdateTheme(); |
330 void AddDevToolsExtensionsToClient(); | 337 void AddDevToolsExtensionsToClient(); |
331 void CallClientFunction(const std::string& function_name, | 338 void CallClientFunction(const std::string& function_name, |
(...skipping 29 matching lines...) Expand all Loading... |
361 IndexingJobsMap indexing_jobs_; | 368 IndexingJobsMap indexing_jobs_; |
362 int width_; | 369 int width_; |
363 int height_; | 370 int height_; |
364 DevToolsDockSide dock_side_before_minimized_; | 371 DevToolsDockSide dock_side_before_minimized_; |
365 // True if we're in the process of handling a beforeunload event originating | 372 // True if we're in the process of handling a beforeunload event originating |
366 // from the inspected webcontents, see InterceptPageBeforeUnload for details. | 373 // from the inspected webcontents, see InterceptPageBeforeUnload for details. |
367 bool intercepted_page_beforeunload_; | 374 bool intercepted_page_beforeunload_; |
368 | 375 |
369 scoped_ptr<DevToolsEmbedderMessageDispatcher> embedder_message_dispatcher_; | 376 scoped_ptr<DevToolsEmbedderMessageDispatcher> embedder_message_dispatcher_; |
370 base::WeakPtrFactory<DevToolsWindow> weak_factory_; | 377 base::WeakPtrFactory<DevToolsWindow> weak_factory_; |
| 378 scoped_refptr<DevToolsPowerProfilerHost> power_profiler_host_; |
| 379 friend class DevToolsPowerProfilerHost; |
371 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); | 380 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); |
372 }; | 381 }; |
373 | 382 |
374 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ | 383 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ |
OLD | NEW |