Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: chrome/browser/ui/webui/uber/uber_ui.cc

Issue 1995113002: Rename WebUI::CallJavascriptFunction to WebUI::CallJavascriptFunctionUnsafe (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698