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

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

Issue 3011002: Add "Inspect Element" shortcut to browser tabs (Closed)
Patch Set: Added TODO, fixed field setting, merged code Created 10 years, 5 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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_DEBUGGER_DEVTOOLS_WINDOW_H_ 5 #ifndef CHROME_BROWSER_DEBUGGER_DEVTOOLS_WINDOW_H_
6 #define CHROME_BROWSER_DEBUGGER_DEVTOOLS_WINDOW_H_ 6 #define CHROME_BROWSER_DEBUGGER_DEVTOOLS_WINDOW_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/scoped_ptr.h" 11 #include "base/scoped_ptr.h"
12 #include "chrome/browser/debugger/devtools_client_host.h" 12 #include "chrome/browser/debugger/devtools_client_host.h"
13 #include "chrome/browser/debugger/devtools_toggle_action.h"
13 #include "chrome/browser/tab_contents/tab_contents_delegate.h" 14 #include "chrome/browser/tab_contents/tab_contents_delegate.h"
14 #include "chrome/common/notification_registrar.h" 15 #include "chrome/common/notification_registrar.h"
15 #include "chrome/common/notification_service.h" 16 #include "chrome/common/notification_service.h"
16 17
17 namespace IPC { 18 namespace IPC {
18 class Message; 19 class Message;
19 } 20 }
20 21
21 class Browser; 22 class Browser;
22 class BrowserWindow; 23 class BrowserWindow;
(...skipping 10 matching lines...) Expand all
33 static TabContents* GetDevToolsContents(TabContents* inspected_tab); 34 static TabContents* GetDevToolsContents(TabContents* inspected_tab);
34 35
35 DevToolsWindow(Profile* profile, RenderViewHost* inspected_rvh, bool docked); 36 DevToolsWindow(Profile* profile, RenderViewHost* inspected_rvh, bool docked);
36 virtual ~DevToolsWindow(); 37 virtual ~DevToolsWindow();
37 38
38 // Overridden from DevToolsClientHost. 39 // Overridden from DevToolsClientHost.
39 virtual DevToolsWindow* AsDevToolsWindow(); 40 virtual DevToolsWindow* AsDevToolsWindow();
40 virtual void SendMessageToClient(const IPC::Message& message); 41 virtual void SendMessageToClient(const IPC::Message& message);
41 virtual void InspectedTabClosing(); 42 virtual void InspectedTabClosing();
42 43
43 void Show(bool open_console); 44 void Show(DevToolsToggleAction action);
44 void Activate(); 45 void Activate();
45 void SetDocked(bool docked); 46 void SetDocked(bool docked);
46 RenderViewHost* GetRenderViewHost(); 47 RenderViewHost* GetRenderViewHost();
47 48
48 TabContents* tab_contents() { return tab_contents_; } 49 TabContents* tab_contents() { return tab_contents_; }
49 Browser* browser() { return browser_; } // For tests. 50 Browser* browser() { return browser_; } // For tests.
50 bool is_docked() { return docked_; } 51 bool is_docked() { return docked_; }
51 52
52 private: 53 private:
53 void CreateDevToolsBrowser(); 54 void CreateDevToolsBrowser();
54 BrowserWindow* GetInspectedBrowserWindow(); 55 BrowserWindow* GetInspectedBrowserWindow();
55 void SetAttachedWindow(); 56 void SetAttachedWindow();
56 57
57 // Overridden from NotificationObserver. 58 // Overridden from NotificationObserver.
58 virtual void Observe(NotificationType type, 59 virtual void Observe(NotificationType type,
59 const NotificationSource& source, 60 const NotificationSource& source,
60 const NotificationDetails& details); 61 const NotificationDetails& details);
61 62
62 void ScheduleOpenConsole(); 63 void ScheduleAction(DevToolsToggleAction action);
63 void DoOpenConsole(); 64 void DoAction();
64 GURL GetDevToolsUrl(); 65 GURL GetDevToolsUrl();
65 void UpdateTheme(); 66 void UpdateTheme();
66 67
67 // Overridden from TabContentsDelegate. 68 // Overridden from TabContentsDelegate.
68 virtual void OpenURLFromTab(TabContents* source, 69 virtual void OpenURLFromTab(TabContents* source,
69 const GURL& url, 70 const GURL& url,
70 const GURL& referrer, 71 const GURL& referrer,
71 WindowOpenDisposition disposition, 72 WindowOpenDisposition disposition,
72 PageTransition::Type transition) {} 73 PageTransition::Type transition) {}
73 virtual void NavigationStateChanged(const TabContents* source, 74 virtual void NavigationStateChanged(const TabContents* source,
(...skipping 15 matching lines...) Expand all
89 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, 90 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
90 bool* is_keyboard_shortcut); 91 bool* is_keyboard_shortcut);
91 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event); 92 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event);
92 93
93 Profile* profile_; 94 Profile* profile_;
94 TabContents* inspected_tab_; 95 TabContents* inspected_tab_;
95 TabContents* tab_contents_; 96 TabContents* tab_contents_;
96 Browser* browser_; 97 Browser* browser_;
97 bool docked_; 98 bool docked_;
98 bool is_loaded_; 99 bool is_loaded_;
99 bool open_console_on_load_; 100 DevToolsToggleAction action_on_load_;
100 NotificationRegistrar registrar_; 101 NotificationRegistrar registrar_;
101 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); 102 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow);
102 }; 103 };
103 104
104 #endif // CHROME_BROWSER_DEBUGGER_DEVTOOLS_WINDOW_H_ 105 #endif // CHROME_BROWSER_DEBUGGER_DEVTOOLS_WINDOW_H_
OLDNEW
« no previous file with comments | « chrome/browser/debugger/devtools_toggle_action.h ('k') | chrome/browser/debugger/devtools_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698