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

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

Issue 599653003: Remove old template html boilerplate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bydefault
Patch Set: fix android Created 6 years, 2 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 "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 19 matching lines...) Expand all
30 using content::NavigationEntry; 30 using content::NavigationEntry;
31 using content::RenderViewHost; 31 using content::RenderViewHost;
32 using content::WebContents; 32 using content::WebContents;
33 33
34 namespace { 34 namespace {
35 35
36 content::WebUIDataSource* CreateUberHTMLSource() { 36 content::WebUIDataSource* CreateUberHTMLSource() {
37 content::WebUIDataSource* source = 37 content::WebUIDataSource* source =
38 content::WebUIDataSource::Create(chrome::kChromeUIUberHost); 38 content::WebUIDataSource::Create(chrome::kChromeUIUberHost);
39 39
40 source->SetUseJsonJSFormatV2();
41 source->SetJsonPath("strings.js"); 40 source->SetJsonPath("strings.js");
42 source->AddResourcePath("uber.js", IDR_UBER_JS); 41 source->AddResourcePath("uber.js", IDR_UBER_JS);
43 source->AddResourcePath("uber_utils.js", IDR_UBER_UTILS_JS); 42 source->AddResourcePath("uber_utils.js", IDR_UBER_UTILS_JS);
44 source->SetDefaultResource(IDR_UBER_HTML); 43 source->SetDefaultResource(IDR_UBER_HTML);
45 source->OverrideContentSecurityPolicyFrameSrc("frame-src chrome:;"); 44 source->OverrideContentSecurityPolicyFrameSrc("frame-src chrome:;");
46 45
47 // Hack alert: continue showing "Loading..." until a real title is set. 46 // Hack alert: continue showing "Loading..." until a real title is set.
48 source->AddLocalizedString("pageTitle", IDS_TAB_LOADING_TITLE); 47 source->AddLocalizedString("pageTitle", IDS_TAB_LOADING_TITLE);
49 48
50 source->AddString("extensionsFrameURL", chrome::kChromeUIExtensionsFrameURL); 49 source->AddString("extensionsFrameURL", chrome::kChromeUIExtensionsFrameURL);
(...skipping 20 matching lines...) Expand all
71 return true; 70 return true;
72 } 71 }
73 72
74 return false; 73 return false;
75 } 74 }
76 75
77 content::WebUIDataSource* CreateUberFrameHTMLSource(Profile* profile) { 76 content::WebUIDataSource* CreateUberFrameHTMLSource(Profile* profile) {
78 content::WebUIDataSource* source = 77 content::WebUIDataSource* source =
79 content::WebUIDataSource::Create(chrome::kChromeUIUberFrameHost); 78 content::WebUIDataSource::Create(chrome::kChromeUIUberFrameHost);
80 79
81 source->SetUseJsonJSFormatV2();
82 source->SetJsonPath("strings.js"); 80 source->SetJsonPath("strings.js");
83 source->AddResourcePath("uber_frame.js", IDR_UBER_FRAME_JS); 81 source->AddResourcePath("uber_frame.js", IDR_UBER_FRAME_JS);
84 source->SetDefaultResource(IDR_UBER_FRAME_HTML); 82 source->SetDefaultResource(IDR_UBER_FRAME_HTML);
85 83
86 // TODO(jhawkins): Attempt to get rid of IDS_SHORT_PRODUCT_OS_NAME. 84 // TODO(jhawkins): Attempt to get rid of IDS_SHORT_PRODUCT_OS_NAME.
87 #if defined(OS_CHROMEOS) 85 #if defined(OS_CHROMEOS)
88 source->AddLocalizedString("shortProductName", IDS_SHORT_PRODUCT_OS_NAME); 86 source->AddLocalizedString("shortProductName", IDS_SHORT_PRODUCT_OS_NAME);
89 #else 87 #else
90 source->AddLocalizedString("shortProductName", IDS_SHORT_PRODUCT_NAME); 88 source->AddLocalizedString("shortProductName", IDS_SHORT_PRODUCT_NAME);
91 #endif // defined(OS_CHROMEOS) 89 #endif // defined(OS_CHROMEOS)
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 web_ui()->CallJavascriptFunction( 220 web_ui()->CallJavascriptFunction(
223 "uber_frame.setNavigationOverride", 221 "uber_frame.setNavigationOverride",
224 base::StringValue(chrome::kChromeUIHistoryHost), 222 base::StringValue(chrome::kChromeUIHistoryHost),
225 base::StringValue(overrides_history ? "yes" : "no")); 223 base::StringValue(overrides_history ? "yes" : "no"));
226 break; 224 break;
227 } 225 }
228 default: 226 default:
229 NOTREACHED(); 227 NOTREACHED();
230 } 228 }
231 } 229 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/translate_internals/translate_internals_ui.cc ('k') | chrome/browser/ui/webui/version_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698