| 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_list.h" | 10 #include "chrome/browser/browser_list.h" |
| 11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/browser_window.h" | 12 #include "chrome/browser/browser_window.h" |
| 13 #include "chrome/browser/debugger/devtools_manager.h" | 13 #include "chrome/browser/debugger/devtools_manager.h" |
| 14 #include "chrome/browser/debugger/devtools_window.h" | 14 #include "chrome/browser/debugger/devtools_window.h" |
| 15 #include "chrome/browser/extensions/extensions_service.h" | 15 #include "chrome/browser/extensions/extension_service.h" |
| 16 #include "chrome/browser/in_process_webkit/session_storage_namespace.h" | 16 #include "chrome/browser/in_process_webkit/session_storage_namespace.h" |
| 17 #include "chrome/browser/load_notification_details.h" | 17 #include "chrome/browser/load_notification_details.h" |
| 18 #include "chrome/browser/prefs/pref_service.h" | 18 #include "chrome/browser/prefs/pref_service.h" |
| 19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/browser/renderer_host/render_view_host.h" | 20 #include "chrome/browser/renderer_host/render_view_host.h" |
| 21 #include "chrome/browser/tab_contents/navigation_controller.h" | 21 #include "chrome/browser/tab_contents/navigation_controller.h" |
| 22 #include "chrome/browser/tab_contents/navigation_entry.h" | 22 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 23 #include "chrome/browser/tab_contents/tab_contents.h" | 23 #include "chrome/browser/tab_contents/tab_contents.h" |
| 24 #include "chrome/browser/tab_contents/tab_contents_view.h" | 24 #include "chrome/browser/tab_contents/tab_contents_view.h" |
| 25 #include "chrome/browser/tabs/tab_strip_model.h" | 25 #include "chrome/browser/tabs/tab_strip_model.h" |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 L"WebInspector.setAttachedWindow(false);"); | 267 L"WebInspector.setAttachedWindow(false);"); |
| 268 } | 268 } |
| 269 | 269 |
| 270 | 270 |
| 271 void DevToolsWindow::AddDevToolsExtensionsToClient() { | 271 void DevToolsWindow::AddDevToolsExtensionsToClient() { |
| 272 if (inspected_tab_) { | 272 if (inspected_tab_) { |
| 273 FundamentalValue tabId(inspected_tab_->controller().session_id().id()); | 273 FundamentalValue tabId(inspected_tab_->controller().session_id().id()); |
| 274 CallClientFunction(L"WebInspector.setInspectedTabId", tabId); | 274 CallClientFunction(L"WebInspector.setInspectedTabId", tabId); |
| 275 } | 275 } |
| 276 ListValue results; | 276 ListValue results; |
| 277 const ExtensionsService* extension_service = | 277 const ExtensionService* extension_service = |
| 278 tab_contents_->tab_contents()->profile()-> | 278 tab_contents_->tab_contents()->profile()-> |
| 279 GetOriginalProfile()->GetExtensionsService(); | 279 GetOriginalProfile()->GetExtensionService(); |
| 280 const ExtensionList* extensions = extension_service->extensions(); | 280 const ExtensionList* extensions = extension_service->extensions(); |
| 281 | 281 |
| 282 for (ExtensionList::const_iterator extension = extensions->begin(); | 282 for (ExtensionList::const_iterator extension = extensions->begin(); |
| 283 extension != extensions->end(); ++extension) { | 283 extension != extensions->end(); ++extension) { |
| 284 if ((*extension)->devtools_url().is_empty()) | 284 if ((*extension)->devtools_url().is_empty()) |
| 285 continue; | 285 continue; |
| 286 DictionaryValue* extension_info = new DictionaryValue(); | 286 DictionaryValue* extension_info = new DictionaryValue(); |
| 287 extension_info->Set("startPage", | 287 extension_info->Set("startPage", |
| 288 new StringValue((*extension)->devtools_url().spec())); | 288 new StringValue((*extension)->devtools_url().spec())); |
| 289 results.Append(extension_info); | 289 results.Append(extension_info); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 return false; | 407 return false; |
| 408 } | 408 } |
| 409 | 409 |
| 410 void DevToolsWindow::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { | 410 void DevToolsWindow::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { |
| 411 if (docked_) { | 411 if (docked_) { |
| 412 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); | 412 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); |
| 413 if (inspected_window) | 413 if (inspected_window) |
| 414 inspected_window->HandleKeyboardEvent(event); | 414 inspected_window->HandleKeyboardEvent(event); |
| 415 } | 415 } |
| 416 } | 416 } |
| OLD | NEW |