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

Side by Side Diff: chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc

Issue 2458833005: Move printing defines to buildflag system. (Closed)
Patch Set: Merge Created 4 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/local_discovery/local_discovery_ui.h" 5 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_finder.h" 10 #include "chrome/browser/ui/browser_finder.h"
11 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h" 11 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h"
12 #include "chrome/browser/ui/webui/metrics_handler.h" 12 #include "chrome/browser/ui/webui/metrics_handler.h"
13 #include "chrome/common/pref_names.h" 13 #include "chrome/common/pref_names.h"
14 #include "chrome/common/url_constants.h" 14 #include "chrome/common/url_constants.h"
15 #include "chrome/grit/browser_resources.h" 15 #include "chrome/grit/browser_resources.h"
16 #include "chrome/grit/generated_resources.h" 16 #include "chrome/grit/generated_resources.h"
17 #include "components/strings/grit/components_strings.h" 17 #include "components/strings/grit/components_strings.h"
18 #include "content/public/browser/web_contents.h" 18 #include "content/public/browser/web_contents.h"
19 #include "content/public/browser/web_ui.h" 19 #include "content/public/browser/web_ui.h"
20 #include "content/public/browser/web_ui_data_source.h" 20 #include "content/public/browser/web_ui_data_source.h"
21 #include "printing/features/features.h"
21 22
22 namespace { 23 namespace {
23 24
24 content::WebUIDataSource* CreateLocalDiscoveryHTMLSource() { 25 content::WebUIDataSource* CreateLocalDiscoveryHTMLSource() {
25 content::WebUIDataSource* source = 26 content::WebUIDataSource* source =
26 content::WebUIDataSource::Create(chrome::kChromeUIDevicesHost); 27 content::WebUIDataSource::Create(chrome::kChromeUIDevicesHost);
27 28
28 source->SetDefaultResource(IDR_LOCAL_DISCOVERY_HTML); 29 source->SetDefaultResource(IDR_LOCAL_DISCOVERY_HTML);
29 source->AddResourcePath("local_discovery.css", IDR_LOCAL_DISCOVERY_CSS); 30 source->AddResourcePath("local_discovery.css", IDR_LOCAL_DISCOVERY_CSS);
30 source->AddResourcePath("local_discovery.js", IDR_LOCAL_DISCOVERY_JS); 31 source->AddResourcePath("local_discovery.js", IDR_LOCAL_DISCOVERY_JS);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 IDS_LOCAL_DISCOVERY_CLOUD_DEVICES_LOGIN); 93 IDS_LOCAL_DISCOVERY_CLOUD_DEVICES_LOGIN);
93 source->AddLocalizedString("registerNeedLogin", 94 source->AddLocalizedString("registerNeedLogin",
94 IDS_LOCAL_DISCOVERY_REGISTER_NEED_LOGIN); 95 IDS_LOCAL_DISCOVERY_REGISTER_NEED_LOGIN);
95 source->AddLocalizedString("availableDevicesTitle", 96 source->AddLocalizedString("availableDevicesTitle",
96 IDS_LOCAL_DISCOVERY_AVAILABLE_DEVICES); 97 IDS_LOCAL_DISCOVERY_AVAILABLE_DEVICES);
97 source->AddLocalizedString("myDevicesTitle", 98 source->AddLocalizedString("myDevicesTitle",
98 IDS_LOCAL_DISCOVERY_MY_DEVICES); 99 IDS_LOCAL_DISCOVERY_MY_DEVICES);
99 source->AddLocalizedString("backButton", IDS_SETTINGS_TITLE); 100 source->AddLocalizedString("backButton", IDS_SETTINGS_TITLE);
100 101
101 // Cloud print connector-related strings. 102 // Cloud print connector-related strings.
102 #if defined(ENABLE_PRINT_PREVIEW) && !defined(OS_CHROMEOS) 103 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) && !defined(OS_CHROMEOS)
103 source->AddLocalizedString("cloudPrintConnectorEnablingButton", 104 source->AddLocalizedString("cloudPrintConnectorEnablingButton",
104 IDS_OPTIONS_CLOUD_PRINT_CONNECTOR_ENABLING_BUTTON); 105 IDS_OPTIONS_CLOUD_PRINT_CONNECTOR_ENABLING_BUTTON);
105 source->AddLocalizedString("cloudPrintConnectorDisabledButton", 106 source->AddLocalizedString("cloudPrintConnectorDisabledButton",
106 IDS_OPTIONS_CLOUD_PRINT_CONNECTOR_DISABLED_BUTTON); 107 IDS_OPTIONS_CLOUD_PRINT_CONNECTOR_DISABLED_BUTTON);
107 source->AddLocalizedString("cloudPrintConnectorEnabledButton", 108 source->AddLocalizedString("cloudPrintConnectorEnabledButton",
108 IDS_OPTIONS_CLOUD_PRINT_CONNECTOR_ENABLED_BUTTON); 109 IDS_OPTIONS_CLOUD_PRINT_CONNECTOR_ENABLED_BUTTON);
109 source->AddLocalizedString("cloudPrintName", 110 source->AddLocalizedString("cloudPrintName",
110 IDS_GOOGLE_CLOUD_PRINT); 111 IDS_GOOGLE_CLOUD_PRINT);
111 source->AddLocalizedString("titleConnector", 112 source->AddLocalizedString("titleConnector",
112 IDS_LOCAL_DISCOVERY_CONNECTOR_SECTION); 113 IDS_LOCAL_DISCOVERY_CONNECTOR_SECTION);
(...skipping 29 matching lines...) Expand all
142 user_prefs::PrefRegistrySyncable* registry) { 143 user_prefs::PrefRegistrySyncable* registry) {
143 registry->RegisterBooleanPref( 144 registry->RegisterBooleanPref(
144 prefs::kLocalDiscoveryNotificationsEnabled, 145 prefs::kLocalDiscoveryNotificationsEnabled,
145 #if defined(OS_WIN) 146 #if defined(OS_WIN)
146 false, 147 false,
147 #else 148 #else
148 true, 149 true,
149 #endif 150 #endif
150 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); 151 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
151 } 152 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698