| 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/uber/uber_ui.h" | 5 #include "chrome/browser/ui/webui/uber/uber_ui.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 if (url == chrome::kChromeUIExtensionsFrameURL || | 153 if (url == chrome::kChromeUIExtensionsFrameURL || |
| 154 url == chrome::kChromeUIHelpFrameURL || | 154 url == chrome::kChromeUIHelpFrameURL || |
| 155 url == chrome::kChromeUIHistoryFrameURL || | 155 url == chrome::kChromeUIHistoryFrameURL || |
| 156 url == chrome::kChromeUISettingsFrameURL || | 156 url == chrome::kChromeUISettingsFrameURL || |
| 157 url == chrome::kChromeUIUberFrameURL) { | 157 url == chrome::kChromeUIUberFrameURL) { |
| 158 webui::LogWebUIUrl(url); | 158 webui::LogWebUIUrl(url); |
| 159 } | 159 } |
| 160 } | 160 } |
| 161 | 161 |
| 162 UberUI::UberUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 162 UberUI::UberUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
| 163 if (!content::IsBrowserSideNavigationEnabled()) { | 163 subframe_logger_ = base::MakeUnique<SubframeLogger>(web_ui->GetWebContents()); |
| 164 // This isn't needed with PlzNavigate because when | |
| 165 // CreateWebUIControllerForURL is called there's always a RenderFrame | |
| 166 // and the logging happens there. | |
| 167 subframe_logger_ = | |
| 168 base::MakeUnique<SubframeLogger>(web_ui->GetWebContents()); | |
| 169 } | |
| 170 content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(), | 164 content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(), |
| 171 CreateUberHTMLSource()); | 165 CreateUberHTMLSource()); |
| 172 | 166 |
| 173 RegisterSubpage(chrome::kChromeUIExtensionsFrameURL, | 167 RegisterSubpage(chrome::kChromeUIExtensionsFrameURL, |
| 174 chrome::kChromeUIExtensionsHost); | 168 chrome::kChromeUIExtensionsHost); |
| 175 RegisterSubpage(chrome::kChromeUIHelpFrameURL, | 169 RegisterSubpage(chrome::kChromeUIHelpFrameURL, |
| 176 chrome::kChromeUIHelpHost); | 170 chrome::kChromeUIHelpHost); |
| 177 RegisterSubpage(chrome::kChromeUIHistoryFrameURL, | 171 RegisterSubpage(chrome::kChromeUIHistoryFrameURL, |
| 178 chrome::kChromeUIHistoryHost); | 172 chrome::kChromeUIHistoryHost); |
| 179 RegisterSubpage(chrome::kChromeUISettingsFrameURL, | 173 RegisterSubpage(chrome::kChromeUISettingsFrameURL, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 // opens the default history page if one is uninstalled or disabled. | 244 // opens the default history page if one is uninstalled or disabled. |
| 251 UpdateHistoryNavigation(web_ui()); | 245 UpdateHistoryNavigation(web_ui()); |
| 252 } | 246 } |
| 253 | 247 |
| 254 void UberFrameUI::OnExtensionUnloaded( | 248 void UberFrameUI::OnExtensionUnloaded( |
| 255 content::BrowserContext* browser_context, | 249 content::BrowserContext* browser_context, |
| 256 const extensions::Extension* extension, | 250 const extensions::Extension* extension, |
| 257 extensions::UnloadedExtensionInfo::Reason reason) { | 251 extensions::UnloadedExtensionInfo::Reason reason) { |
| 258 UpdateHistoryNavigation(web_ui()); | 252 UpdateHistoryNavigation(web_ui()); |
| 259 } | 253 } |
| OLD | NEW |