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/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 10 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 source->AddBoolean("profileIsGuest", | 120 source->AddBoolean("profileIsGuest", |
121 Profile::FromBrowserContext(browser_context)->IsGuestSession()); | 121 Profile::FromBrowserContext(browser_context)->IsGuestSession()); |
122 | 122 |
123 return source; | 123 return source; |
124 } | 124 } |
125 | 125 |
126 void UpdateHistoryNavigation(content::WebUI* web_ui) { | 126 void UpdateHistoryNavigation(content::WebUI* web_ui) { |
127 bool overrides_history = | 127 bool overrides_history = |
128 HasExtensionType(web_ui->GetWebContents()->GetBrowserContext(), | 128 HasExtensionType(web_ui->GetWebContents()->GetBrowserContext(), |
129 chrome::kChromeUIHistoryHost); | 129 chrome::kChromeUIHistoryHost); |
130 web_ui->CallJavascriptFunction( | 130 web_ui->CallJavascriptFunctionUnsafe( |
131 "uber_frame.setNavigationOverride", | 131 "uber_frame.setNavigationOverride", |
132 base::StringValue(chrome::kChromeUIHistoryHost), | 132 base::StringValue(chrome::kChromeUIHistoryHost), |
133 base::StringValue(overrides_history ? "yes" : "no")); | 133 base::StringValue(overrides_history ? "yes" : "no")); |
134 } | 134 } |
135 | 135 |
136 } // namespace | 136 } // namespace |
137 | 137 |
138 SubframeLogger::SubframeLogger(content::WebContents* contents) | 138 SubframeLogger::SubframeLogger(content::WebContents* contents) |
139 : WebContentsObserver(contents) {} | 139 : WebContentsObserver(contents) {} |
140 | 140 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 // opens the default history page if one is uninstalled or disabled. | 241 // opens the default history page if one is uninstalled or disabled. |
242 UpdateHistoryNavigation(web_ui()); | 242 UpdateHistoryNavigation(web_ui()); |
243 } | 243 } |
244 | 244 |
245 void UberFrameUI::OnExtensionUnloaded( | 245 void UberFrameUI::OnExtensionUnloaded( |
246 content::BrowserContext* browser_context, | 246 content::BrowserContext* browser_context, |
247 const extensions::Extension* extension, | 247 const extensions::Extension* extension, |
248 extensions::UnloadedExtensionInfo::Reason reason) { | 248 extensions::UnloadedExtensionInfo::Reason reason) { |
249 UpdateHistoryNavigation(web_ui()); | 249 UpdateHistoryNavigation(web_ui()); |
250 } | 250 } |
OLD | NEW |