Chromium Code Reviews| 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/bookmarks/bookmark_utils.h" | 5 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 165 const extensions::ExtensionSet& extension_set = | 165 const extensions::ExtensionSet& extension_set = |
| 166 registry->enabled_extensions(); | 166 registry->enabled_extensions(); |
| 167 | 167 |
| 168 // This flag tracks whether any extension wants the disposition to be | 168 // This flag tracks whether any extension wants the disposition to be |
| 169 // removed. | 169 // removed. |
| 170 bool removed = false; | 170 bool removed = false; |
| 171 for (extensions::ExtensionSet::const_iterator i = extension_set.begin(); | 171 for (extensions::ExtensionSet::const_iterator i = extension_set.begin(); |
| 172 i != extension_set.end(); | 172 i != extension_set.end(); |
| 173 ++i) { | 173 ++i) { |
| 174 // Use the overridden disposition if any extension wants it. | 174 // Use the overridden disposition if any extension wants it. |
| 175 if (command_service->OverridesBookmarkShortcut(*i)) | 175 if (command_service->OverridesBookmarkShortcut(i->get())) |
| 176 return BOOKMARK_SHORTCUT_DISPOSITION_OVERRIDDEN; | 176 return BOOKMARK_SHORTCUT_DISPOSITION_OVERRIDDEN; |
| 177 | 177 |
| 178 if (!removed && extensions::CommandService::RemovesBookmarkShortcut(*i)) | 178 if (!removed && |
| 179 extensions::CommandService::RemovesBookmarkShortcut(i->get())) { | |
| 179 removed = true; | 180 removed = true; |
|
msw
2014/08/27 00:02:39
nit: Actually, I guess this could be:
removed |= e
dcheng
2014/08/27 00:05:20
I'm happy to clean this up in a separate patch, bu
msw
2014/08/27 00:07:27
Absolutely, lgtm as-is, feel free to clean this up
| |
| 181 } | |
| 180 } | 182 } |
| 181 | 183 |
| 182 if (removed) | 184 if (removed) |
| 183 return BOOKMARK_SHORTCUT_DISPOSITION_REMOVED; | 185 return BOOKMARK_SHORTCUT_DISPOSITION_REMOVED; |
| 184 return BOOKMARK_SHORTCUT_DISPOSITION_UNCHANGED; | 186 return BOOKMARK_SHORTCUT_DISPOSITION_UNCHANGED; |
| 185 } | 187 } |
| 186 | 188 |
| 187 } // namespace | 189 } // namespace |
| 188 | 190 |
| 189 void OpenAll(gfx::NativeWindow parent, | 191 void OpenAll(gfx::NativeWindow parent, |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 348 extensions::ExtensionRegistry::Get(profile); | 350 extensions::ExtensionRegistry::Get(profile); |
| 349 if (!registry) | 351 if (!registry) |
| 350 return false; | 352 return false; |
| 351 | 353 |
| 352 const extensions::ExtensionSet& extension_set = | 354 const extensions::ExtensionSet& extension_set = |
| 353 registry->enabled_extensions(); | 355 registry->enabled_extensions(); |
| 354 | 356 |
| 355 for (extensions::ExtensionSet::const_iterator i = extension_set.begin(); | 357 for (extensions::ExtensionSet::const_iterator i = extension_set.begin(); |
| 356 i != extension_set.end(); | 358 i != extension_set.end(); |
| 357 ++i) { | 359 ++i) { |
| 358 if (extensions::CommandService::RemovesBookmarkOpenPagesShortcut(*i)) | 360 if (extensions::CommandService::RemovesBookmarkOpenPagesShortcut(i->get())) |
| 359 return true; | 361 return true; |
| 360 } | 362 } |
| 361 | 363 |
| 362 return false; | 364 return false; |
| 363 } | 365 } |
| 364 | 366 |
| 365 } // namespace chrome | 367 } // namespace chrome |
| OLD | NEW |