Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: chrome/browser/ui/bookmarks/bookmark_context_menu_controller_unittest.cc

Issue 865163003: bookmarks: Move BookmarkNode into 'bookmarks' namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: enhanced_bookmarks fix Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <string> 7 #include <string>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
12 #include "base/values.h" 12 #include "base/values.h"
13 #include "chrome/app/chrome_command_ids.h" 13 #include "chrome/app/chrome_command_ids.h"
14 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 14 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
15 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" 16 #include "chrome/browser/ui/bookmarks/bookmark_utils.h"
17 #include "chrome/common/pref_names.h" 17 #include "chrome/common/pref_names.h"
18 #include "chrome/test/base/testing_pref_service_syncable.h" 18 #include "chrome/test/base/testing_pref_service_syncable.h"
19 #include "chrome/test/base/testing_profile.h" 19 #include "chrome/test/base/testing_profile.h"
20 #include "components/bookmarks/browser/bookmark_model.h" 20 #include "components/bookmarks/browser/bookmark_model.h"
21 #include "components/bookmarks/browser/bookmark_node.h" 21 #include "components/bookmarks/browser/bookmark_node.h"
22 #include "components/bookmarks/test/bookmark_test_helpers.h" 22 #include "components/bookmarks/test/bookmark_test_helpers.h"
23 #include "content/public/browser/page_navigator.h" 23 #include "content/public/browser/page_navigator.h"
24 #include "content/public/test/test_browser_thread.h" 24 #include "content/public/test/test_browser_thread.h"
25 #include "testing/gtest/include/gtest/gtest.h" 25 #include "testing/gtest/include/gtest/gtest.h"
26 #include "ui/base/clipboard/clipboard.h" 26 #include "ui/base/clipboard/clipboard.h"
27 27
28 using base::ASCIIToUTF16; 28 using base::ASCIIToUTF16;
29 using bookmarks::BookmarkModel; 29 using bookmarks::BookmarkModel;
30 using bookmarks::BookmarkNode;
30 using content::BrowserThread; 31 using content::BrowserThread;
31 using content::OpenURLParams; 32 using content::OpenURLParams;
32 using content::PageNavigator; 33 using content::PageNavigator;
33 using content::WebContents; 34 using content::WebContents;
34 35
35 // PageNavigator implementation that records the URL. 36 // PageNavigator implementation that records the URL.
36 class TestingPageNavigator : public PageNavigator { 37 class TestingPageNavigator : public PageNavigator {
37 public: 38 public:
38 WebContents* OpenURL(const OpenURLParams& params) override { 39 WebContents* OpenURL(const OpenURLParams& params) override {
39 urls_.push_back(params.url); 40 urls_.push_back(params.url);
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 new base::FundamentalValue(false)); 355 new base::FundamentalValue(false));
355 EXPECT_FALSE( 356 EXPECT_FALSE(
356 controller.IsCommandIdEnabled(IDC_BOOKMARK_BAR_SHOW_APPS_SHORTCUT)); 357 controller.IsCommandIdEnabled(IDC_BOOKMARK_BAR_SHOW_APPS_SHORTCUT));
357 358
358 // And enabling the shortcut by policy disables the command too. 359 // And enabling the shortcut by policy disables the command too.
359 prefs->SetManagedPref(bookmarks::prefs::kShowAppsShortcutInBookmarkBar, 360 prefs->SetManagedPref(bookmarks::prefs::kShowAppsShortcutInBookmarkBar,
360 new base::FundamentalValue(true)); 361 new base::FundamentalValue(true));
361 EXPECT_FALSE( 362 EXPECT_FALSE(
362 controller.IsCommandIdEnabled(IDC_BOOKMARK_BAR_SHOW_APPS_SHORTCUT)); 363 controller.IsCommandIdEnabled(IDC_BOOKMARK_BAR_SHOW_APPS_SHORTCUT));
363 } 364 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698