OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/json/json_writer.h" | 6 #include "base/json/json_writer.h" |
7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/browser.h" | 10 #include "chrome/browser/browser.h" |
11 #include "chrome/browser/browser_list.h" | 11 #include "chrome/browser/browser_list.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/browser_window.h" | 13 #include "chrome/browser/browser_window.h" |
14 #include "chrome/browser/debugger/devtools_manager.h" | 14 #include "chrome/browser/debugger/devtools_manager.h" |
15 #include "chrome/browser/debugger/devtools_window.h" | 15 #include "chrome/browser/debugger/devtools_window.h" |
16 #include "chrome/browser/extensions/extensions_service.h" | 16 #include "chrome/browser/extensions/extensions_service.h" |
| 17 #include "chrome/browser/in_process_webkit/session_storage_namespace.h" |
17 #include "chrome/browser/load_notification_details.h" | 18 #include "chrome/browser/load_notification_details.h" |
18 #include "chrome/browser/prefs/pref_service.h" | 19 #include "chrome/browser/prefs/pref_service.h" |
19 #include "chrome/browser/profile.h" | 20 #include "chrome/browser/profile.h" |
20 #include "chrome/browser/renderer_host/render_view_host.h" | 21 #include "chrome/browser/renderer_host/render_view_host.h" |
21 #include "chrome/browser/tab_contents/navigation_controller.h" | 22 #include "chrome/browser/tab_contents/navigation_controller.h" |
22 #include "chrome/browser/tab_contents/navigation_entry.h" | 23 #include "chrome/browser/tab_contents/navigation_entry.h" |
23 #include "chrome/browser/tab_contents/tab_contents.h" | 24 #include "chrome/browser/tab_contents/tab_contents.h" |
24 #include "chrome/browser/tab_contents/tab_contents_view.h" | 25 #include "chrome/browser/tab_contents/tab_contents_view.h" |
25 #include "chrome/browser/tabs/tab_strip_model.h" | 26 #include "chrome/browser/tabs/tab_strip_model.h" |
26 #include "chrome/browser/themes/browser_theme_provider.h" | 27 #include "chrome/browser/themes/browser_theme_provider.h" |
(...skipping 30 matching lines...) Expand all Loading... |
57 | 58 |
58 DevToolsWindow::DevToolsWindow(Profile* profile, | 59 DevToolsWindow::DevToolsWindow(Profile* profile, |
59 RenderViewHost* inspected_rvh, | 60 RenderViewHost* inspected_rvh, |
60 bool docked) | 61 bool docked) |
61 : profile_(profile), | 62 : profile_(profile), |
62 browser_(NULL), | 63 browser_(NULL), |
63 docked_(docked), | 64 docked_(docked), |
64 is_loaded_(false), | 65 is_loaded_(false), |
65 action_on_load_(DEVTOOLS_TOGGLE_ACTION_NONE) { | 66 action_on_load_(DEVTOOLS_TOGGLE_ACTION_NONE) { |
66 // Create TabContents with devtools. | 67 // Create TabContents with devtools. |
67 tab_contents_ = new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL); | 68 tab_contents_ = new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL, NULL); |
68 tab_contents_->render_view_host()->AllowBindings(BindingsPolicy::DOM_UI); | 69 tab_contents_->render_view_host()->AllowBindings(BindingsPolicy::DOM_UI); |
69 tab_contents_->controller().LoadURL( | 70 tab_contents_->controller().LoadURL( |
70 GetDevToolsUrl(), GURL(), PageTransition::START_PAGE); | 71 GetDevToolsUrl(), GURL(), PageTransition::START_PAGE); |
71 | 72 |
72 // Wipe out page icon so that the default application icon is used. | 73 // Wipe out page icon so that the default application icon is used. |
73 NavigationEntry* entry = tab_contents_->controller().GetActiveEntry(); | 74 NavigationEntry* entry = tab_contents_->controller().GetActiveEntry(); |
74 entry->favicon().set_bitmap(SkBitmap()); | 75 entry->favicon().set_bitmap(SkBitmap()); |
75 entry->favicon().set_is_valid(true); | 76 entry->favicon().set_is_valid(true); |
76 | 77 |
77 // Register on-load actions. | 78 // Register on-load actions. |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 return false; | 380 return false; |
380 } | 381 } |
381 | 382 |
382 void DevToolsWindow::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { | 383 void DevToolsWindow::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { |
383 if (docked_) { | 384 if (docked_) { |
384 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); | 385 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); |
385 if (inspected_window) | 386 if (inspected_window) |
386 inspected_window->HandleKeyboardEvent(event); | 387 inspected_window->HandleKeyboardEvent(event); |
387 } | 388 } |
388 } | 389 } |
OLD | NEW |