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

Side by Side Diff: chrome/browser/ui/views/media_router/media_router_ui_browsertest.cc

Issue 2613713005: Make ToolbarActionsModel own ComponentToolbarActionsFactory (Closed)
Patch Set: Created 3 years, 11 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/threading/thread_task_runner_handle.h" 6 #include "base/threading/thread_task_runner_handle.h"
7 #include "chrome/browser/extensions/browser_action_test_util.h" 7 #include "chrome/browser/extensions/browser_action_test_util.h"
8 #include "chrome/browser/media/router/media_router_ui_service.h" 8 #include "chrome/browser/media/router/media_router_ui_service.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_commands.h" 10 #include "chrome/browser/ui/browser_commands.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 91
92 bool ActionExists() { 92 bool ActionExists() {
93 return ToolbarActionsModel::Get(browser()->profile()) 93 return ToolbarActionsModel::Get(browser()->profile())
94 ->HasComponentAction( 94 ->HasComponentAction(
95 ComponentToolbarActionsFactory::kMediaRouterActionId); 95 ComponentToolbarActionsFactory::kMediaRouterActionId);
96 } 96 }
97 97
98 void SetAlwaysShowActionPref(bool always_show) { 98 void SetAlwaysShowActionPref(bool always_show) {
99 return ToolbarActionsModel::Get(browser()->profile()) 99 return ToolbarActionsModel::Get(browser()->profile())
100 ->component_migration_helper() 100 ->GetComponentMigrationHelper()
101 ->SetComponentActionPref( 101 ->SetComponentActionPref(
102 ComponentToolbarActionsFactory::kMediaRouterActionId, always_show); 102 ComponentToolbarActionsFactory::kMediaRouterActionId, always_show);
103 } 103 }
104 104
105 protected: 105 protected:
106 ToolbarActionsBar* toolbar_actions_bar_ = nullptr; 106 ToolbarActionsBar* toolbar_actions_bar_ = nullptr;
107 107
108 Issue issue_; 108 Issue issue_;
109 109
110 // A vector of MediaRoutes that includes a local route. 110 // A vector of MediaRoutes that includes a local route.
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 action_controller_->OnRoutesUpdated(std::vector<MediaRoute>(), 210 action_controller_->OnRoutesUpdated(std::vector<MediaRoute>(),
211 std::vector<MediaRoute::Id>()); 211 std::vector<MediaRoute::Id>());
212 EXPECT_FALSE(ActionExists()); 212 EXPECT_FALSE(ActionExists());
213 action_controller_->OnRoutesUpdated(routes_, std::vector<MediaRoute::Id>()); 213 action_controller_->OnRoutesUpdated(routes_, std::vector<MediaRoute::Id>());
214 EXPECT_TRUE(ActionExists()); 214 EXPECT_TRUE(ActionExists());
215 browser2->window()->Close(); 215 browser2->window()->Close();
216 EXPECT_TRUE(ActionExists()); 216 EXPECT_TRUE(ActionExists());
217 } 217 }
218 218
219 } // namespace media_router 219 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698