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/browser_command_controller.h" | 5 #include "chrome/browser/ui/browser_command_controller.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1266 | 1266 |
1267 UpdateCommandsForBookmarkBar(); | 1267 UpdateCommandsForBookmarkBar(); |
1268 } | 1268 } |
1269 | 1269 |
1270 void BrowserCommandController::UpdatePrintingState() { | 1270 void BrowserCommandController::UpdatePrintingState() { |
1271 bool print_enabled = CanPrint(browser_); | 1271 bool print_enabled = CanPrint(browser_); |
1272 command_updater_.UpdateCommandEnabled(IDC_PRINT, print_enabled); | 1272 command_updater_.UpdateCommandEnabled(IDC_PRINT, print_enabled); |
1273 #if !defined(DISABLE_BASIC_PRINTING) | 1273 #if !defined(DISABLE_BASIC_PRINTING) |
1274 command_updater_.UpdateCommandEnabled(IDC_BASIC_PRINT, | 1274 command_updater_.UpdateCommandEnabled(IDC_BASIC_PRINT, |
1275 CanBasicPrint(browser_)); | 1275 CanBasicPrint(browser_)); |
1276 #elif defined(OS_WIN) | 1276 #endif // !DISABLE_BASIC_PRINTING |
1277 HMODULE metro_module = base::win::GetMetroModule(); | |
1278 if (metro_module != NULL) { | |
1279 typedef void (*MetroEnablePrinting)(BOOL); | |
1280 MetroEnablePrinting metro_enable_printing = | |
1281 reinterpret_cast<MetroEnablePrinting>( | |
1282 ::GetProcAddress(metro_module, "MetroEnablePrinting")); | |
1283 if (metro_enable_printing) | |
1284 metro_enable_printing(print_enabled); | |
1285 } | |
1286 #endif // !OS_WIN | |
1287 } | 1277 } |
1288 | 1278 |
1289 void BrowserCommandController::UpdateSaveAsState() { | 1279 void BrowserCommandController::UpdateSaveAsState() { |
1290 command_updater_.UpdateCommandEnabled(IDC_SAVE_PAGE, CanSavePage(browser_)); | 1280 command_updater_.UpdateCommandEnabled(IDC_SAVE_PAGE, CanSavePage(browser_)); |
1291 } | 1281 } |
1292 | 1282 |
1293 void BrowserCommandController::UpdateShowSyncState(bool show_main_ui) { | 1283 void BrowserCommandController::UpdateShowSyncState(bool show_main_ui) { |
1294 command_updater_.UpdateCommandEnabled( | 1284 command_updater_.UpdateCommandEnabled( |
1295 IDC_SHOW_SYNC_SETUP, show_main_ui && pref_signin_allowed_.GetValue()); | 1285 IDC_SHOW_SYNC_SETUP, show_main_ui && pref_signin_allowed_.GetValue()); |
1296 } | 1286 } |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1352 | 1342 |
1353 BrowserWindow* BrowserCommandController::window() { | 1343 BrowserWindow* BrowserCommandController::window() { |
1354 return browser_->window(); | 1344 return browser_->window(); |
1355 } | 1345 } |
1356 | 1346 |
1357 Profile* BrowserCommandController::profile() { | 1347 Profile* BrowserCommandController::profile() { |
1358 return browser_->profile(); | 1348 return browser_->profile(); |
1359 } | 1349 } |
1360 | 1350 |
1361 } // namespace chrome | 1351 } // namespace chrome |
OLD | NEW |