| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 28 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 29 #include "chrome/common/chrome_notification_types.h" | 29 #include "chrome/common/chrome_notification_types.h" |
| 30 #include "chrome/common/chrome_switches.h" | 30 #include "chrome/common/chrome_switches.h" |
| 31 #include "chrome/common/pref_names.h" | 31 #include "chrome/common/pref_names.h" |
| 32 #include "chrome/common/render_messages.h" | 32 #include "chrome/common/render_messages.h" |
| 33 #include "chrome/common/url_constants.h" | 33 #include "chrome/common/url_constants.h" |
| 34 #include "content/browser/browsing_instance.h" | 34 #include "content/browser/browsing_instance.h" |
| 35 #include "content/browser/in_process_webkit/session_storage_namespace.h" | 35 #include "content/browser/in_process_webkit/session_storage_namespace.h" |
| 36 #include "content/browser/load_notification_details.h" | 36 #include "content/browser/load_notification_details.h" |
| 37 #include "content/browser/renderer_host/render_view_host.h" | 37 #include "content/browser/renderer_host/render_view_host.h" |
| 38 #include "content/browser/tab_contents/navigation_controller.h" | |
| 39 #include "content/browser/tab_contents/tab_contents.h" | 38 #include "content/browser/tab_contents/tab_contents.h" |
| 40 #include "content/browser/tab_contents/tab_contents_view.h" | 39 #include "content/browser/tab_contents/tab_contents_view.h" |
| 41 #include "content/public/browser/content_browser_client.h" | 40 #include "content/public/browser/content_browser_client.h" |
| 42 #include "content/public/browser/devtools_agent_host_registry.h" | 41 #include "content/public/browser/devtools_agent_host_registry.h" |
| 43 #include "content/public/browser/devtools_manager.h" | 42 #include "content/public/browser/devtools_manager.h" |
| 44 #include "content/public/browser/favicon_status.h" | 43 #include "content/public/browser/favicon_status.h" |
| 44 #include "content/public/browser/navigation_controller.h" |
| 45 #include "content/public/browser/navigation_entry.h" | 45 #include "content/public/browser/navigation_entry.h" |
| 46 #include "content/public/browser/notification_source.h" | 46 #include "content/public/browser/notification_source.h" |
| 47 #include "content/public/common/bindings_policy.h" | 47 #include "content/public/common/bindings_policy.h" |
| 48 #include "grit/generated_resources.h" | 48 #include "grit/generated_resources.h" |
| 49 | 49 |
| 50 typedef std::vector<DevToolsWindow*> DevToolsWindowList; | 50 typedef std::vector<DevToolsWindow*> DevToolsWindowList; |
| 51 namespace { | 51 namespace { |
| 52 base::LazyInstance<DevToolsWindowList, | 52 base::LazyInstance<DevToolsWindowList, |
| 53 base::LeakyLazyInstanceTraits<DevToolsWindowList> > | 53 base::LeakyLazyInstanceTraits<DevToolsWindowList> > |
| 54 g_instances = LAZY_INSTANCE_INITIALIZER; | 54 g_instances = LAZY_INSTANCE_INITIALIZER; |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 browser_->tabstrip_model()->AddTabContents( | 376 browser_->tabstrip_model()->AddTabContents( |
| 377 tab_contents_, -1, content::PAGE_TRANSITION_START_PAGE, | 377 tab_contents_, -1, content::PAGE_TRANSITION_START_PAGE, |
| 378 TabStripModel::ADD_ACTIVE); | 378 TabStripModel::ADD_ACTIVE); |
| 379 } | 379 } |
| 380 | 380 |
| 381 bool DevToolsWindow::FindInspectedBrowserAndTabIndex(Browser** browser, | 381 bool DevToolsWindow::FindInspectedBrowserAndTabIndex(Browser** browser, |
| 382 int* tab) { | 382 int* tab) { |
| 383 if (!inspected_tab_) | 383 if (!inspected_tab_) |
| 384 return false; | 384 return false; |
| 385 | 385 |
| 386 const NavigationController& controller = | 386 const content::NavigationController& controller = |
| 387 inspected_tab_->tab_contents()->GetController(); | 387 inspected_tab_->tab_contents()->GetController(); |
| 388 for (BrowserList::const_iterator it = BrowserList::begin(); | 388 for (BrowserList::const_iterator it = BrowserList::begin(); |
| 389 it != BrowserList::end(); ++it) { | 389 it != BrowserList::end(); ++it) { |
| 390 int tab_index = (*it)->GetIndexOfController(&controller); | 390 int tab_index = (*it)->GetIndexOfController(&controller); |
| 391 if (tab_index != TabStripModel::kNoTab) { | 391 if (tab_index != TabStripModel::kNoTab) { |
| 392 *browser = *it; | 392 *browser = *it; |
| 393 *tab = tab_index; | 393 *tab = tab_index; |
| 394 return true; | 394 return true; |
| 395 } | 395 } |
| 396 } | 396 } |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 content); | 722 content); |
| 723 } | 723 } |
| 724 | 724 |
| 725 content::JavaScriptDialogCreator* DevToolsWindow::GetJavaScriptDialogCreator() { | 725 content::JavaScriptDialogCreator* DevToolsWindow::GetJavaScriptDialogCreator() { |
| 726 if (inspected_tab_ && inspected_tab_->tab_contents()->GetDelegate()) { | 726 if (inspected_tab_ && inspected_tab_->tab_contents()->GetDelegate()) { |
| 727 return inspected_tab_->tab_contents()->GetDelegate()-> | 727 return inspected_tab_->tab_contents()->GetDelegate()-> |
| 728 GetJavaScriptDialogCreator(); | 728 GetJavaScriptDialogCreator(); |
| 729 } | 729 } |
| 730 return content::WebContentsDelegate::GetJavaScriptDialogCreator(); | 730 return content::WebContentsDelegate::GetJavaScriptDialogCreator(); |
| 731 } | 731 } |
| OLD | NEW |