| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 // Component extensions with background that do not have an options page | 130 // Component extensions with background that do not have an options page |
| 131 // will cause this menu item to go to the extensions page with an | 131 // will cause this menu item to go to the extensions page with an |
| 132 // absent component extension. | 132 // absent component extension. |
| 133 // | 133 // |
| 134 // Ideally, we would remove this item, but this conflicts with the user | 134 // Ideally, we would remove this item, but this conflicts with the user |
| 135 // model where this menu shows the extensions with background. | 135 // model where this menu shows the extensions with background. |
| 136 // | 136 // |
| 137 // The compromise is to disable the item, avoiding the non-actionable | 137 // The compromise is to disable the item, avoiding the non-actionable |
| 138 // navigate to the extensions page and preserving the user model. | 138 // navigate to the extensions page and preserving the user model. |
| 139 if ((*cursor)->location() == extensions::Manifest::COMPONENT) { | 139 if ((*cursor)->location() == extensions::Manifest::COMPONENT) { |
| 140 GURL options_page = extensions::ManifestURL::GetOptionsPage(*cursor); | 140 GURL options_page = |
| 141 extensions::ManifestURL::GetOptionsPage(cursor->get()); |
| 141 if (!options_page.is_valid()) | 142 if (!options_page.is_valid()) |
| 142 menu->SetCommandIdEnabled(command_id, false); | 143 menu->SetCommandIdEnabled(command_id, false); |
| 143 } | 144 } |
| 144 } | 145 } |
| 145 } | 146 } |
| 146 if (containing_menu) { | 147 if (containing_menu) { |
| 147 int menu_command_id = command_id_extension_vector_->size(); | 148 int menu_command_id = command_id_extension_vector_->size(); |
| 148 // Check that the command ID is within the dynamic range. | 149 // Check that the command ID is within the dynamic range. |
| 149 DCHECK(menu_command_id < IDC_MinimumLabelValue); | 150 DCHECK(menu_command_id < IDC_MinimumLabelValue); |
| 150 command_id_extension_vector_->push_back(kInvalidExtensionIndex); | 151 command_id_extension_vector_->push_back(kInvalidExtensionIndex); |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 } | 800 } |
| 800 } | 801 } |
| 801 return profile_it; | 802 return profile_it; |
| 802 } | 803 } |
| 803 | 804 |
| 804 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const { | 805 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const { |
| 805 PrefService* service = g_browser_process->local_state(); | 806 PrefService* service = g_browser_process->local_state(); |
| 806 DCHECK(service); | 807 DCHECK(service); |
| 807 return service->GetBoolean(prefs::kBackgroundModeEnabled); | 808 return service->GetBoolean(prefs::kBackgroundModeEnabled); |
| 808 } | 809 } |
| OLD | NEW |