| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 126 |
| 127 return source; | 127 return source; |
| 128 } | 128 } |
| 129 | 129 |
| 130 void UpdateHistoryNavigation(content::WebUI* web_ui) { | 130 void UpdateHistoryNavigation(content::WebUI* web_ui) { |
| 131 bool overrides_history = | 131 bool overrides_history = |
| 132 HasExtensionType(web_ui->GetWebContents()->GetBrowserContext(), | 132 HasExtensionType(web_ui->GetWebContents()->GetBrowserContext(), |
| 133 chrome::kChromeUIHistoryHost); | 133 chrome::kChromeUIHistoryHost); |
| 134 web_ui->CallJavascriptFunctionUnsafe( | 134 web_ui->CallJavascriptFunctionUnsafe( |
| 135 "uber_frame.setNavigationOverride", | 135 "uber_frame.setNavigationOverride", |
| 136 base::StringValue(chrome::kChromeUIHistoryHost), | 136 base::Value(chrome::kChromeUIHistoryHost), |
| 137 base::StringValue(overrides_history ? "yes" : "no")); | 137 base::Value(overrides_history ? "yes" : "no")); |
| 138 } | 138 } |
| 139 | 139 |
| 140 } // namespace | 140 } // namespace |
| 141 | 141 |
| 142 SubframeLogger::SubframeLogger(content::WebContents* contents) | 142 SubframeLogger::SubframeLogger(content::WebContents* contents) |
| 143 : WebContentsObserver(contents) {} | 143 : WebContentsObserver(contents) {} |
| 144 | 144 |
| 145 SubframeLogger::~SubframeLogger() {} | 145 SubframeLogger::~SubframeLogger() {} |
| 146 | 146 |
| 147 void SubframeLogger::DidFinishNavigation( | 147 void SubframeLogger::DidFinishNavigation( |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 // opens the default history page if one is uninstalled or disabled. | 250 // opens the default history page if one is uninstalled or disabled. |
| 251 UpdateHistoryNavigation(web_ui()); | 251 UpdateHistoryNavigation(web_ui()); |
| 252 } | 252 } |
| 253 | 253 |
| 254 void UberFrameUI::OnExtensionUnloaded( | 254 void UberFrameUI::OnExtensionUnloaded( |
| 255 content::BrowserContext* browser_context, | 255 content::BrowserContext* browser_context, |
| 256 const extensions::Extension* extension, | 256 const extensions::Extension* extension, |
| 257 extensions::UnloadedExtensionInfo::Reason reason) { | 257 extensions::UnloadedExtensionInfo::Reason reason) { |
| 258 UpdateHistoryNavigation(web_ui()); | 258 UpdateHistoryNavigation(web_ui()); |
| 259 } | 259 } |
| OLD | NEW |