| 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_context_menu_controller.h" | 5 #include "chrome/browser/ui/bookmarks/bookmark_context_menu_controller.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 // By default, the pref is not managed and the command is enabled. | 341 // By default, the pref is not managed and the command is enabled. |
| 342 sync_preferences::TestingPrefServiceSyncable* prefs = | 342 sync_preferences::TestingPrefServiceSyncable* prefs = |
| 343 profile_->GetTestingPrefService(); | 343 profile_->GetTestingPrefService(); |
| 344 EXPECT_FALSE(prefs->IsManagedPreference( | 344 EXPECT_FALSE(prefs->IsManagedPreference( |
| 345 bookmarks::prefs::kShowAppsShortcutInBookmarkBar)); | 345 bookmarks::prefs::kShowAppsShortcutInBookmarkBar)); |
| 346 EXPECT_TRUE( | 346 EXPECT_TRUE( |
| 347 controller.IsCommandIdEnabled(IDC_BOOKMARK_BAR_SHOW_APPS_SHORTCUT)); | 347 controller.IsCommandIdEnabled(IDC_BOOKMARK_BAR_SHOW_APPS_SHORTCUT)); |
| 348 | 348 |
| 349 // Disabling the shorcut by policy disables the command. | 349 // Disabling the shorcut by policy disables the command. |
| 350 prefs->SetManagedPref(bookmarks::prefs::kShowAppsShortcutInBookmarkBar, | 350 prefs->SetManagedPref(bookmarks::prefs::kShowAppsShortcutInBookmarkBar, |
| 351 new base::FundamentalValue(false)); | 351 new base::Value(false)); |
| 352 EXPECT_FALSE( | 352 EXPECT_FALSE( |
| 353 controller.IsCommandIdEnabled(IDC_BOOKMARK_BAR_SHOW_APPS_SHORTCUT)); | 353 controller.IsCommandIdEnabled(IDC_BOOKMARK_BAR_SHOW_APPS_SHORTCUT)); |
| 354 | 354 |
| 355 // And enabling the shortcut by policy disables the command too. | 355 // And enabling the shortcut by policy disables the command too. |
| 356 prefs->SetManagedPref(bookmarks::prefs::kShowAppsShortcutInBookmarkBar, | 356 prefs->SetManagedPref(bookmarks::prefs::kShowAppsShortcutInBookmarkBar, |
| 357 new base::FundamentalValue(true)); | 357 new base::Value(true)); |
| 358 EXPECT_FALSE( | 358 EXPECT_FALSE( |
| 359 controller.IsCommandIdEnabled(IDC_BOOKMARK_BAR_SHOW_APPS_SHORTCUT)); | 359 controller.IsCommandIdEnabled(IDC_BOOKMARK_BAR_SHOW_APPS_SHORTCUT)); |
| 360 } | 360 } |
| OLD | NEW |