| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "chrome/browser/ui/browser.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #endif // OS_WIN | 10 #endif // OS_WIN |
| (...skipping 4370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4381 UpdatePrintingState(restrictions); | 4381 UpdatePrintingState(restrictions); |
| 4382 } | 4382 } |
| 4383 | 4383 |
| 4384 void Browser::UpdatePrintingState(int content_restrictions) { | 4384 void Browser::UpdatePrintingState(int content_restrictions) { |
| 4385 bool enabled = true; | 4385 bool enabled = true; |
| 4386 bool selected_tab_is_preview_tab = false; | 4386 bool selected_tab_is_preview_tab = false; |
| 4387 if (content_restrictions & CONTENT_RESTRICTION_PRINT) { | 4387 if (content_restrictions & CONTENT_RESTRICTION_PRINT) { |
| 4388 enabled = false; | 4388 enabled = false; |
| 4389 selected_tab_is_preview_tab = | 4389 selected_tab_is_preview_tab = |
| 4390 printing::PrintPreviewTabController::IsPrintPreviewTab( | 4390 printing::PrintPreviewTabController::IsPrintPreviewTab( |
| 4391 GetSelectedTabContents()); | 4391 GetSelectedTabContentsWrapper()); |
| 4392 } else if (g_browser_process->local_state()) { | 4392 } else if (g_browser_process->local_state()) { |
| 4393 enabled = g_browser_process->local_state()-> | 4393 enabled = g_browser_process->local_state()-> |
| 4394 GetBoolean(prefs::kPrintingEnabled); | 4394 GetBoolean(prefs::kPrintingEnabled); |
| 4395 } | 4395 } |
| 4396 command_updater_.UpdateCommandEnabled(IDC_PRINT, enabled); | 4396 command_updater_.UpdateCommandEnabled(IDC_PRINT, enabled); |
| 4397 command_updater_.UpdateCommandEnabled(IDC_ADVANCED_PRINT, | 4397 command_updater_.UpdateCommandEnabled(IDC_ADVANCED_PRINT, |
| 4398 selected_tab_is_preview_tab ? true : | 4398 selected_tab_is_preview_tab ? true : |
| 4399 enabled); | 4399 enabled); |
| 4400 } | 4400 } |
| 4401 | 4401 |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5116 } | 5116 } |
| 5117 | 5117 |
| 5118 void Browser::ShowSyncSetup() { | 5118 void Browser::ShowSyncSetup() { |
| 5119 ProfileSyncService* service = | 5119 ProfileSyncService* service = |
| 5120 profile()->GetOriginalProfile()->GetProfileSyncService(); | 5120 profile()->GetOriginalProfile()->GetProfileSyncService(); |
| 5121 if (service->HasSyncSetupCompleted()) | 5121 if (service->HasSyncSetupCompleted()) |
| 5122 ShowOptionsTab(chrome::kSyncSetupSubPage); | 5122 ShowOptionsTab(chrome::kSyncSetupSubPage); |
| 5123 else | 5123 else |
| 5124 service->ShowLoginDialog(); | 5124 service->ShowLoginDialog(); |
| 5125 } | 5125 } |
| OLD | NEW |