| 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 4689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4700 void Browser::UpdateCommandsForBookmarkBar() { | 4700 void Browser::UpdateCommandsForBookmarkBar() { |
| 4701 const bool show_main_ui = IsShowingMainUI(window_ && window_->IsFullscreen()); | 4701 const bool show_main_ui = IsShowingMainUI(window_ && window_->IsFullscreen()); |
| 4702 command_updater_.UpdateCommandEnabled(IDC_SHOW_BOOKMARK_BAR, | 4702 command_updater_.UpdateCommandEnabled(IDC_SHOW_BOOKMARK_BAR, |
| 4703 browser_defaults::bookmarks_enabled && | 4703 browser_defaults::bookmarks_enabled && |
| 4704 !profile_->GetPrefs()->IsManagedPreference(prefs::kShowBookmarkBar) && | 4704 !profile_->GetPrefs()->IsManagedPreference(prefs::kShowBookmarkBar) && |
| 4705 show_main_ui); | 4705 show_main_ui); |
| 4706 } | 4706 } |
| 4707 | 4707 |
| 4708 void Browser::MarkHomePageAsChanged(PrefService* pref_service) { | 4708 void Browser::MarkHomePageAsChanged(PrefService* pref_service) { |
| 4709 pref_service->SetBoolean(prefs::kHomePageChanged, true); | 4709 pref_service->SetBoolean(prefs::kHomePageChanged, true); |
| 4710 pref_service->ScheduleSavePersistentPrefs(); | |
| 4711 } | 4710 } |
| 4712 | 4711 |
| 4713 void Browser::UpdateSaveAsState(int content_restrictions) { | 4712 void Browser::UpdateSaveAsState(int content_restrictions) { |
| 4714 bool enabled = !(content_restrictions & content::CONTENT_RESTRICTION_SAVE); | 4713 bool enabled = !(content_restrictions & content::CONTENT_RESTRICTION_SAVE); |
| 4715 PrefService* state = g_browser_process->local_state(); | 4714 PrefService* state = g_browser_process->local_state(); |
| 4716 if (state) | 4715 if (state) |
| 4717 enabled = enabled && state->GetBoolean(prefs::kAllowFileSelectionDialogs); | 4716 enabled = enabled && state->GetBoolean(prefs::kAllowFileSelectionDialogs); |
| 4718 | 4717 |
| 4719 command_updater_.UpdateCommandEnabled(IDC_SAVE_PAGE, enabled); | 4718 command_updater_.UpdateCommandEnabled(IDC_SAVE_PAGE, enabled); |
| 4720 } | 4719 } |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5377 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); | 5376 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); |
| 5378 } else { | 5377 } else { |
| 5379 GlobalErrorService* service = | 5378 GlobalErrorService* service = |
| 5380 GlobalErrorServiceFactory::GetForProfile(profile()); | 5379 GlobalErrorServiceFactory::GetForProfile(profile()); |
| 5381 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); | 5380 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); |
| 5382 if (error) { | 5381 if (error) { |
| 5383 error->ShowBubbleView(this); | 5382 error->ShowBubbleView(this); |
| 5384 } | 5383 } |
| 5385 } | 5384 } |
| 5386 } | 5385 } |
| OLD | NEW |