| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/views/bookmarks/bookmark_bar_view.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" |
| 6 | 6 |
| 7 #include "apps/app_launcher.h" | 7 #include "apps/app_launcher.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/search/search.h" | 10 #include "chrome/browser/search/search.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 BookmarkBarView bookmark_bar_view(browser(), NULL); | 67 BookmarkBarView bookmark_bar_view(browser(), NULL); |
| 68 bookmark_bar_view.set_owned_by_client(); | 68 bookmark_bar_view.set_owned_by_client(); |
| 69 browser()->profile()->GetPrefs()->SetBoolean( | 69 browser()->profile()->GetPrefs()->SetBoolean( |
| 70 prefs::kShowAppsShortcutInBookmarkBar, false); | 70 prefs::kShowAppsShortcutInBookmarkBar, false); |
| 71 EXPECT_FALSE(bookmark_bar_view.apps_page_shortcut_->visible()); | 71 EXPECT_FALSE(bookmark_bar_view.apps_page_shortcut_->visible()); |
| 72 | 72 |
| 73 // Try to make the Apps shortcut visible. Its visibility depends on whether | 73 // Try to make the Apps shortcut visible. Its visibility depends on whether |
| 74 // the app launcher is enabled. | 74 // the app launcher is enabled. |
| 75 browser()->profile()->GetPrefs()->SetBoolean( | 75 browser()->profile()->GetPrefs()->SetBoolean( |
| 76 prefs::kShowAppsShortcutInBookmarkBar, true); | 76 prefs::kShowAppsShortcutInBookmarkBar, true); |
| 77 if (apps::WasAppLauncherEnabled()) { | 77 if (apps::IsAppLauncherEnabled()) { |
| 78 EXPECT_FALSE(bookmark_bar_view.apps_page_shortcut_->visible()); | 78 EXPECT_FALSE(bookmark_bar_view.apps_page_shortcut_->visible()); |
| 79 } else { | 79 } else { |
| 80 EXPECT_TRUE(bookmark_bar_view.apps_page_shortcut_->visible()); | 80 EXPECT_TRUE(bookmark_bar_view.apps_page_shortcut_->visible()); |
| 81 } | 81 } |
| 82 | 82 |
| 83 // Make sure we can also properly transition from true to false. | 83 // Make sure we can also properly transition from true to false. |
| 84 browser()->profile()->GetPrefs()->SetBoolean( | 84 browser()->profile()->GetPrefs()->SetBoolean( |
| 85 prefs::kShowAppsShortcutInBookmarkBar, false); | 85 prefs::kShowAppsShortcutInBookmarkBar, false); |
| 86 EXPECT_FALSE(bookmark_bar_view.apps_page_shortcut_->visible()); | 86 EXPECT_FALSE(bookmark_bar_view.apps_page_shortcut_->visible()); |
| 87 } | 87 } |
| OLD | NEW |