Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
| 8 #include "chrome/browser/extensions/browser_action_test_util.h" | 8 #include "chrome/browser/extensions/browser_action_test_util.h" |
| 9 #include "chrome/browser/media/router/media_router_ui_service.h" | 9 #include "chrome/browser/media/router/media_router_ui_service.h" |
| 10 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti l.h" | 10 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti l.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 GetMediaRouterAction()->ExecuteAction(true); | 94 GetMediaRouterAction()->ExecuteAction(true); |
| 95 } | 95 } |
| 96 | 96 |
| 97 bool ActionExists() { | 97 bool ActionExists() { |
| 98 return ToolbarActionsModel::Get(browser()->profile()) | 98 return ToolbarActionsModel::Get(browser()->profile()) |
| 99 ->HasComponentAction( | 99 ->HasComponentAction( |
| 100 ComponentToolbarActionsFactory::kMediaRouterActionId); | 100 ComponentToolbarActionsFactory::kMediaRouterActionId); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void SetAlwaysShowActionPref(bool always_show) { | 103 void SetAlwaysShowActionPref(bool always_show) { |
| 104 return ToolbarActionsModel::Get(browser()->profile()) | 104 return MediaRouterActionController::SetAlwaysShowActionPref( |
|
Devlin
2017/02/08 15:20:01
no return from void function
takumif
2017/02/08 17:38:15
Oops, fixed.
| |
| 105 ->component_migration_helper() | 105 browser()->profile(), always_show); |
| 106 ->SetComponentActionPref( | |
| 107 ComponentToolbarActionsFactory::kMediaRouterActionId, always_show); | |
| 108 } | 106 } |
| 109 | 107 |
| 110 AppMenuButton* GetAppMenuButton() { | 108 AppMenuButton* GetAppMenuButton() { |
| 111 return BrowserView::GetBrowserViewForBrowser(browser()) | 109 return BrowserView::GetBrowserViewForBrowser(browser()) |
| 112 ->toolbar() | 110 ->toolbar() |
| 113 ->app_menu_button(); | 111 ->app_menu_button(); |
| 114 } | 112 } |
| 115 | 113 |
| 116 protected: | 114 protected: |
| 117 ToolbarActionsBar* toolbar_actions_bar_ = nullptr; | 115 ToolbarActionsBar* toolbar_actions_bar_ = nullptr; |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 320 action_controller_->OnRoutesUpdated(std::vector<MediaRoute>(), | 318 action_controller_->OnRoutesUpdated(std::vector<MediaRoute>(), |
| 321 std::vector<MediaRoute::Id>()); | 319 std::vector<MediaRoute::Id>()); |
| 322 EXPECT_FALSE(ActionExists()); | 320 EXPECT_FALSE(ActionExists()); |
| 323 action_controller_->OnRoutesUpdated(routes_, std::vector<MediaRoute::Id>()); | 321 action_controller_->OnRoutesUpdated(routes_, std::vector<MediaRoute::Id>()); |
| 324 EXPECT_TRUE(ActionExists()); | 322 EXPECT_TRUE(ActionExists()); |
| 325 browser2->window()->Close(); | 323 browser2->window()->Close(); |
| 326 EXPECT_TRUE(ActionExists()); | 324 EXPECT_TRUE(ActionExists()); |
| 327 } | 325 } |
| 328 | 326 |
| 329 } // namespace media_router | 327 } // namespace media_router |
| OLD | NEW |