| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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/recovery/recovery_install_global_error.h" | 5 #include "chrome/browser/recovery/recovery_install_global_error.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/component_updater/recovery_component_installer.h" | 10 #include "chrome/browser/component_updater/recovery_component_installer.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 58 } |
| 59 | 59 |
| 60 int RecoveryInstallGlobalError::MenuItemCommandID() { | 60 int RecoveryInstallGlobalError::MenuItemCommandID() { |
| 61 return IDC_ELEVATED_RECOVERY_DIALOG; | 61 return IDC_ELEVATED_RECOVERY_DIALOG; |
| 62 } | 62 } |
| 63 | 63 |
| 64 base::string16 RecoveryInstallGlobalError::MenuItemLabel() { | 64 base::string16 RecoveryInstallGlobalError::MenuItemLabel() { |
| 65 return l10n_util::GetStringUTF16(IDS_UPDATE_NOW); | 65 return l10n_util::GetStringUTF16(IDS_UPDATE_NOW); |
| 66 } | 66 } |
| 67 | 67 |
| 68 int RecoveryInstallGlobalError::MenuItemIconResourceID() { | 68 gfx::Image RecoveryInstallGlobalError::MenuItemIcon() { |
| 69 return IDR_UPDATE_MENU_SEVERITY_HIGH; | 69 return ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
| 70 IDR_UPDATE_MENU_SEVERITY_HIGH); |
| 70 } | 71 } |
| 71 | 72 |
| 72 void RecoveryInstallGlobalError::ExecuteMenuItem(Browser* browser) { | 73 void RecoveryInstallGlobalError::ExecuteMenuItem(Browser* browser) { |
| 73 ShowBubbleView(browser); | 74 ShowBubbleView(browser); |
| 74 } | 75 } |
| 75 | 76 |
| 76 bool RecoveryInstallGlobalError::HasBubbleView() { | 77 bool RecoveryInstallGlobalError::HasBubbleView() { |
| 77 return HasElevationNotification(); | 78 return HasElevationNotification(); |
| 78 } | 79 } |
| 79 | 80 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 DCHECK(pref->FindPreference(prefs::kRecoveryComponentNeedsElevation)); | 145 DCHECK(pref->FindPreference(prefs::kRecoveryComponentNeedsElevation)); |
| 145 elevation_needed_ = pref->GetBoolean(prefs::kRecoveryComponentNeedsElevation); | 146 elevation_needed_ = pref->GetBoolean(prefs::kRecoveryComponentNeedsElevation); |
| 146 | 147 |
| 147 // Got a new elevation request, resets |has_shown_bubble_view_| so the | 148 // Got a new elevation request, resets |has_shown_bubble_view_| so the |
| 148 // bubble has a higher priority to show. | 149 // bubble has a higher priority to show. |
| 149 if (elevation_needed_) | 150 if (elevation_needed_) |
| 150 has_shown_bubble_view_ = false; | 151 has_shown_bubble_view_ = false; |
| 151 | 152 |
| 152 GlobalErrorServiceFactory::GetForProfile(profile_)->NotifyErrorsChanged(this); | 153 GlobalErrorServiceFactory::GetForProfile(profile_)->NotifyErrorsChanged(this); |
| 153 } | 154 } |
| OLD | NEW |