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

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

Issue 22972007: Migrate DevToolsWindow from specific to opaque frontend host messages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 3 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
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_file_helper.h" 16 #include "chrome/browser/devtools/devtools_file_helper.h"
16 #include "chrome/browser/devtools/devtools_file_system_indexer.h" 17 #include "chrome/browser/devtools/devtools_file_system_indexer.h"
17 #include "chrome/browser/devtools/devtools_toggle_action.h" 18 #include "chrome/browser/devtools/devtools_toggle_action.h"
18 #include "content/public/browser/devtools_client_host.h" 19 #include "content/public/browser/devtools_client_host.h"
19 #include "content/public/browser/devtools_frontend_host_delegate.h" 20 #include "content/public/browser/devtools_frontend_host_delegate.h"
20 #include "content/public/browser/notification_observer.h" 21 #include "content/public/browser/notification_observer.h"
21 #include "content/public/browser/notification_registrar.h" 22 #include "content/public/browser/notification_registrar.h"
22 #include "content/public/browser/web_contents_delegate.h" 23 #include "content/public/browser/web_contents_delegate.h"
23 24
24 class Browser; 25 class Browser;
(...skipping 23 matching lines...) Expand all
48 49
49 enum DevToolsDockSide { 50 enum DevToolsDockSide {
50 DEVTOOLS_DOCK_SIDE_UNDOCKED = 0, 51 DEVTOOLS_DOCK_SIDE_UNDOCKED = 0,
51 DEVTOOLS_DOCK_SIDE_BOTTOM, 52 DEVTOOLS_DOCK_SIDE_BOTTOM,
52 DEVTOOLS_DOCK_SIDE_RIGHT, 53 DEVTOOLS_DOCK_SIDE_RIGHT,
53 DEVTOOLS_DOCK_SIDE_MINIMIZED 54 DEVTOOLS_DOCK_SIDE_MINIMIZED
54 }; 55 };
55 56
56 class DevToolsWindow : private content::NotificationObserver, 57 class DevToolsWindow : private content::NotificationObserver,
57 private content::WebContentsDelegate, 58 private content::WebContentsDelegate,
58 private content::DevToolsFrontendHostDelegate { 59 private content::DevToolsFrontendHostDelegate,
60 private DevToolsEmbedderMessageDispatcher::Delegate {
59 public: 61 public:
60 typedef base::Callback<void(bool)> InfoBarCallback; 62 typedef base::Callback<void(bool)> InfoBarCallback;
61 63
62 static const char kDevToolsApp[]; 64 static const char kDevToolsApp[];
63 65
64 virtual ~DevToolsWindow(); 66 virtual ~DevToolsWindow();
65 67
66 static std::string GetDevToolsWindowPlacementPrefKey(); 68 static std::string GetDevToolsWindowPlacementPrefKey();
67 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); 69 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
68 static DevToolsWindow* GetDockedInstanceForInspectedTab( 70 static DevToolsWindow* GetDockedInstanceForInspectedTab(
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 virtual content::JavaScriptDialogManager* 176 virtual content::JavaScriptDialogManager*
175 GetJavaScriptDialogManager() OVERRIDE; 177 GetJavaScriptDialogManager() OVERRIDE;
176 virtual content::ColorChooser* OpenColorChooser( 178 virtual content::ColorChooser* OpenColorChooser(
177 content::WebContents* web_contents, 179 content::WebContents* web_contents,
178 SkColor color) OVERRIDE; 180 SkColor color) OVERRIDE;
179 virtual void RunFileChooser( 181 virtual void RunFileChooser(
180 content::WebContents* web_contents, 182 content::WebContents* web_contents,
181 const content::FileChooserParams& params) OVERRIDE; 183 const content::FileChooserParams& params) OVERRIDE;
182 virtual void WebContentsFocused(content::WebContents* contents) OVERRIDE; 184 virtual void WebContentsFocused(content::WebContents* contents) OVERRIDE;
183 185
184 // content::DevToolsFrontendHostDelegate: 186 // content::DevToolsFrontendHostDelegate override:
187 virtual void DispatchOnEmbedder(const std::string& message) OVERRIDE;
188
189 // DevToolsEmbedderMessageDispatcher::Delegate overrides:
185 virtual void ActivateWindow() OVERRIDE; 190 virtual void ActivateWindow() OVERRIDE;
186 virtual void ChangeAttachedWindowHeight(unsigned height) OVERRIDE;
187 virtual void CloseWindow() OVERRIDE; 191 virtual void CloseWindow() OVERRIDE;
188 virtual void MoveWindow(int x, int y) OVERRIDE; 192 virtual void MoveWindow(int x, int y) OVERRIDE;
189 virtual void SetDockSide(const std::string& side) OVERRIDE; 193 virtual void SetDockSide(const std::string& side) OVERRIDE;
190 virtual void OpenInNewTab(const std::string& url) OVERRIDE; 194 virtual void OpenInNewTab(const std::string& url) OVERRIDE;
191 virtual void SaveToFile(const std::string& url, 195 virtual void SaveToFile(const std::string& url,
192 const std::string& content, 196 const std::string& content,
193 bool save_as) OVERRIDE; 197 bool save_as) OVERRIDE;
194 virtual void AppendToFile(const std::string& url, 198 virtual void AppendToFile(const std::string& url,
195 const std::string& content) OVERRIDE; 199 const std::string& content) OVERRIDE;
196 virtual void RequestFileSystems() OVERRIDE; 200 virtual void RequestFileSystems() OVERRIDE;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 scoped_refptr<DevToolsFileSystemIndexer> file_system_indexer_; 263 scoped_refptr<DevToolsFileSystemIndexer> file_system_indexer_;
260 typedef std::map< 264 typedef std::map<
261 int, 265 int,
262 scoped_refptr<DevToolsFileSystemIndexer::FileSystemIndexingJob> > 266 scoped_refptr<DevToolsFileSystemIndexer::FileSystemIndexingJob> >
263 IndexingJobsMap; 267 IndexingJobsMap;
264 IndexingJobsMap indexing_jobs_; 268 IndexingJobsMap indexing_jobs_;
265 int width_; 269 int width_;
266 int height_; 270 int height_;
267 DevToolsDockSide dock_side_before_minimized_; 271 DevToolsDockSide dock_side_before_minimized_;
268 272
273 scoped_ptr<DevToolsEmbedderMessageDispatcher> embedder_message_dispatcher_;
269 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); 274 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow);
270 }; 275 };
271 276
272 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ 277 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_
OLDNEW
« no previous file with comments | « chrome/browser/devtools/devtools_embedder_message_dispatcher.cc ('k') | chrome/browser/devtools/devtools_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698