OLD | NEW |
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 #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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 entry->GetFavicon().valid = true; | 208 entry->GetFavicon().valid = true; |
209 | 209 |
210 // Register on-load actions. | 210 // Register on-load actions. |
211 registrar_.Add( | 211 registrar_.Add( |
212 this, | 212 this, |
213 content::NOTIFICATION_LOAD_STOP, | 213 content::NOTIFICATION_LOAD_STOP, |
214 content::Source<NavigationController>( | 214 content::Source<NavigationController>( |
215 &tab_contents_->web_contents()->GetController())); | 215 &tab_contents_->web_contents()->GetController())); |
216 registrar_.Add( | 216 registrar_.Add( |
217 this, | 217 this, |
218 content::NOTIFICATION_TAB_CLOSING, | 218 chrome::NOTIFICATION_TAB_CLOSING, |
219 content::Source<NavigationController>( | 219 content::Source<NavigationController>( |
220 &tab_contents_->web_contents()->GetController())); | 220 &tab_contents_->web_contents()->GetController())); |
221 registrar_.Add( | 221 registrar_.Add( |
222 this, | 222 this, |
223 chrome::NOTIFICATION_BROWSER_THEME_CHANGED, | 223 chrome::NOTIFICATION_BROWSER_THEME_CHANGED, |
224 content::Source<ThemeService>( | 224 content::Source<ThemeService>( |
225 ThemeServiceFactory::GetForProfile(profile_))); | 225 ThemeServiceFactory::GetForProfile(profile_))); |
226 // There is no inspected_rvh in case of shared workers. | 226 // There is no inspected_rvh in case of shared workers. |
227 if (inspected_rvh) { | 227 if (inspected_rvh) { |
228 WebContents* tab = inspected_rvh->GetDelegate()->GetAsWebContents(); | 228 WebContents* tab = inspected_rvh->GetDelegate()->GetAsWebContents(); |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 } | 480 } |
481 | 481 |
482 void DevToolsWindow::Observe(int type, | 482 void DevToolsWindow::Observe(int type, |
483 const content::NotificationSource& source, | 483 const content::NotificationSource& source, |
484 const content::NotificationDetails& details) { | 484 const content::NotificationDetails& details) { |
485 if (type == content::NOTIFICATION_LOAD_STOP && !is_loaded_) { | 485 if (type == content::NOTIFICATION_LOAD_STOP && !is_loaded_) { |
486 is_loaded_ = true; | 486 is_loaded_ = true; |
487 UpdateTheme(); | 487 UpdateTheme(); |
488 DoAction(); | 488 DoAction(); |
489 AddDevToolsExtensionsToClient(); | 489 AddDevToolsExtensionsToClient(); |
490 } else if (type == content::NOTIFICATION_TAB_CLOSING) { | 490 } else if (type == chrome::NOTIFICATION_TAB_CLOSING) { |
491 if (content::Source<NavigationController>(source).ptr() == | 491 if (content::Source<NavigationController>(source).ptr() == |
492 &tab_contents_->web_contents()->GetController()) { | 492 &tab_contents_->web_contents()->GetController()) { |
493 // This happens when browser closes all of its tabs as a result | 493 // This happens when browser closes all of its tabs as a result |
494 // of window.Close event. | 494 // of window.Close event. |
495 // Notify manager that this DevToolsClientHost no longer exists and | 495 // Notify manager that this DevToolsClientHost no longer exists and |
496 // initiate self-destuct here. | 496 // initiate self-destuct here. |
497 DevToolsManager::GetInstance()->ClientHostClosing(frontend_host_); | 497 DevToolsManager::GetInstance()->ClientHostClosing(frontend_host_); |
498 delete this; | 498 delete this; |
499 } | 499 } |
500 } else if (type == chrome::NOTIFICATION_BROWSER_THEME_CHANGED) { | 500 } else if (type == chrome::NOTIFICATION_BROWSER_THEME_CHANGED) { |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 CallClientFunction("InspectorFrontendAPI.savedURL", &url_value); | 744 CallClientFunction("InspectorFrontendAPI.savedURL", &url_value); |
745 } | 745 } |
746 | 746 |
747 content::JavaScriptDialogCreator* DevToolsWindow::GetJavaScriptDialogCreator() { | 747 content::JavaScriptDialogCreator* DevToolsWindow::GetJavaScriptDialogCreator() { |
748 if (inspected_tab_ && inspected_tab_->web_contents()->GetDelegate()) { | 748 if (inspected_tab_ && inspected_tab_->web_contents()->GetDelegate()) { |
749 return inspected_tab_->web_contents()->GetDelegate()-> | 749 return inspected_tab_->web_contents()->GetDelegate()-> |
750 GetJavaScriptDialogCreator(); | 750 GetJavaScriptDialogCreator(); |
751 } | 751 } |
752 return content::WebContentsDelegate::GetJavaScriptDialogCreator(); | 752 return content::WebContentsDelegate::GetJavaScriptDialogCreator(); |
753 } | 753 } |
OLD | NEW |