| 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 "chrome/browser/ui/webui/inspect_ui.h" | 5 #include "chrome/browser/ui/webui/inspect_ui.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 DictionaryValue* BuildTargetDescriptor(RenderViewHost* rvh, bool is_tab) { | 156 DictionaryValue* BuildTargetDescriptor(RenderViewHost* rvh, bool is_tab) { |
| 157 WebContents* web_contents = WebContents::FromRenderViewHost(rvh); | 157 WebContents* web_contents = WebContents::FromRenderViewHost(rvh); |
| 158 std::string title; | 158 std::string title; |
| 159 std::string target_type = is_tab ? kPageTargetType : ""; | 159 std::string target_type = is_tab ? kPageTargetType : ""; |
| 160 GURL url; | 160 GURL url; |
| 161 GURL favicon_url; | 161 GURL favicon_url; |
| 162 if (web_contents) { | 162 if (web_contents) { |
| 163 url = web_contents->GetURL(); | 163 url = web_contents->GetURL(); |
| 164 title = UTF16ToUTF8(web_contents->GetTitle()); | 164 title = UTF16ToUTF8(web_contents->GetTitle()); |
| 165 content::NavigationController& controller = web_contents->GetController(); | 165 content::NavigationController& controller = web_contents->GetController(); |
| 166 content::NavigationEntry* entry = controller.GetActiveEntry(); | 166 content::NavigationEntry* entry = controller.GetVisibleEntry(); |
| 167 if (entry != NULL && entry->GetURL().is_valid()) | 167 if (entry != NULL && entry->GetURL().is_valid()) |
| 168 favicon_url = entry->GetFavicon().url; | 168 favicon_url = entry->GetFavicon().url; |
| 169 | 169 |
| 170 Profile* profile = Profile::FromBrowserContext( | 170 Profile* profile = Profile::FromBrowserContext( |
| 171 web_contents->GetBrowserContext()); | 171 web_contents->GetBrowserContext()); |
| 172 if (profile) { | 172 if (profile) { |
| 173 ExtensionService* extension_service = profile->GetExtensionService(); | 173 ExtensionService* extension_service = profile->GetExtensionService(); |
| 174 const extensions::Extension* extension = extension_service-> | 174 const extensions::Extension* extension = extension_service-> |
| 175 extensions()->GetByID(url.host()); | 175 extensions()->GetByID(url.host()); |
| 176 if (extension) { | 176 if (extension) { |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 base::DictionaryValue default_config; | 822 base::DictionaryValue default_config; |
| 823 default_config.SetString( | 823 default_config.SetString( |
| 824 kPortForwardingDefaultPort, kPortForwardingDefaultLocation); | 824 kPortForwardingDefaultPort, kPortForwardingDefaultLocation); |
| 825 prefs->Set(prefs::kDevToolsPortForwardingConfig, default_config); | 825 prefs->Set(prefs::kDevToolsPortForwardingConfig, default_config); |
| 826 } | 826 } |
| 827 | 827 |
| 828 const base::Value* InspectUI::GetPrefValue(const char* name) { | 828 const base::Value* InspectUI::GetPrefValue(const char* name) { |
| 829 Profile* profile = Profile::FromWebUI(web_ui()); | 829 Profile* profile = Profile::FromWebUI(web_ui()); |
| 830 return profile->GetPrefs()->FindPreference(name)->GetValue(); | 830 return profile->GetPrefs()->FindPreference(name)->GetValue(); |
| 831 } | 831 } |
| OLD | NEW |