OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #include "testing/gtest/include/gtest/gtest.h" | 48 #include "testing/gtest/include/gtest/gtest.h" |
49 | 49 |
50 namespace { | 50 namespace { |
51 | 51 |
52 const char kId1[] = "iccfkkhkfiphcjdakkmcjmkfboccmndk"; | 52 const char kId1[] = "iccfkkhkfiphcjdakkmcjmkfboccmndk"; |
53 const char kId2[] = "ajjhifimiemdpmophmkkkcijegphclbl"; | 53 const char kId2[] = "ajjhifimiemdpmophmkkkcijegphclbl"; |
54 const char kId3[] = "ioibbbfddncmmabjmpokikkeiofalaek"; | 54 const char kId3[] = "ioibbbfddncmmabjmpokikkeiofalaek"; |
55 | 55 |
56 std::unique_ptr<KeyedService> BuildOverrideRegistrar( | 56 std::unique_ptr<KeyedService> BuildOverrideRegistrar( |
57 content::BrowserContext* context) { | 57 content::BrowserContext* context) { |
58 return base::WrapUnique( | 58 return base::MakeUnique<extensions::ExtensionWebUIOverrideRegistrar>(context); |
59 new extensions::ExtensionWebUIOverrideRegistrar(context)); | |
60 } | 59 } |
61 | 60 |
62 // Creates a new ToolbarActionsModel for the given |context|. | 61 // Creates a new ToolbarActionsModel for the given |context|. |
63 std::unique_ptr<KeyedService> BuildToolbarModel( | 62 std::unique_ptr<KeyedService> BuildToolbarModel( |
64 content::BrowserContext* context) { | 63 content::BrowserContext* context) { |
65 return base::WrapUnique( | 64 return base::MakeUnique<ToolbarActionsModel>( |
66 new ToolbarActionsModel(Profile::FromBrowserContext(context), | 65 Profile::FromBrowserContext(context), |
67 extensions::ExtensionPrefs::Get(context))); | 66 extensions::ExtensionPrefs::Get(context)); |
68 } | 67 } |
69 | 68 |
70 } // namespace | 69 } // namespace |
71 | 70 |
72 namespace extensions { | 71 namespace extensions { |
73 | 72 |
74 class TestExtensionMessageBubbleController : | 73 class TestExtensionMessageBubbleController : |
75 public ExtensionMessageBubbleController { | 74 public ExtensionMessageBubbleController { |
76 public: | 75 public: |
77 TestExtensionMessageBubbleController( | 76 TestExtensionMessageBubbleController( |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 EXPECT_TRUE(controller->ShouldShow()); | 1042 EXPECT_TRUE(controller->ShouldShow()); |
1044 EXPECT_EQ(1u, model->toolbar_items().size()); | 1043 EXPECT_EQ(1u, model->toolbar_items().size()); |
1045 controller->HighlightExtensionsIfNecessary(); | 1044 controller->HighlightExtensionsIfNecessary(); |
1046 EXPECT_TRUE(ToolbarActionsModel::Get(profile())->is_highlighting()); | 1045 EXPECT_TRUE(ToolbarActionsModel::Get(profile())->is_highlighting()); |
1047 set_browser(nullptr); | 1046 set_browser(nullptr); |
1048 EXPECT_FALSE(ToolbarActionsModel::Get(profile())->is_highlighting()); | 1047 EXPECT_FALSE(ToolbarActionsModel::Get(profile())->is_highlighting()); |
1049 controller.reset(); | 1048 controller.reset(); |
1050 } | 1049 } |
1051 | 1050 |
1052 } // namespace extensions | 1051 } // namespace extensions |
OLD | NEW |