| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "chrome/browser/extensions/component_migration_helper.h" | 10 #include "chrome/browser/extensions/component_migration_helper.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 explicit MediaRouterActionController(Profile* profile); | 24 explicit MediaRouterActionController(Profile* profile); |
| 25 // Constructor for injecting dependencies in tests. | 25 // Constructor for injecting dependencies in tests. |
| 26 MediaRouterActionController( | 26 MediaRouterActionController( |
| 27 Profile* profile, | 27 Profile* profile, |
| 28 media_router::MediaRouter* router, | 28 media_router::MediaRouter* router, |
| 29 ComponentMigrationHelper::ComponentActionDelegate* | 29 ComponentMigrationHelper::ComponentActionDelegate* |
| 30 component_action_delegate, | 30 component_action_delegate, |
| 31 ComponentMigrationHelper* component_migration_helper); | 31 ComponentMigrationHelper* component_migration_helper); |
| 32 ~MediaRouterActionController() override; | 32 ~MediaRouterActionController() override; |
| 33 | 33 |
| 34 // Whether the media router action is shown by an administrator policy. |
| 35 static bool IsActionShownByPolicy(Profile* profile); |
| 36 |
| 34 // media_router::IssuesObserver: | 37 // media_router::IssuesObserver: |
| 35 void OnIssue(const media_router::Issue& issue) override; | 38 void OnIssue(const media_router::Issue& issue) override; |
| 36 void OnIssuesCleared() override; | 39 void OnIssuesCleared() override; |
| 37 | 40 |
| 38 // media_router::MediaRoutesObserver: | 41 // media_router::MediaRoutesObserver: |
| 39 void OnRoutesUpdated(const std::vector<media_router::MediaRoute>& routes, | 42 void OnRoutesUpdated(const std::vector<media_router::MediaRoute>& routes, |
| 40 const std::vector<media_router::MediaRoute::Id>& | 43 const std::vector<media_router::MediaRoute::Id>& |
| 41 joinable_route_ids) override; | 44 joinable_route_ids) override; |
| 42 | 45 |
| 43 // Called when a Media Router dialog is shown or hidden, and updates the | 46 // Called when a Media Router dialog is shown or hidden, and updates the |
| (...skipping 26 matching lines...) Expand all Loading... |
| 70 ComponentMigrationHelper::ComponentActionDelegate* const | 73 ComponentMigrationHelper::ComponentActionDelegate* const |
| 71 component_action_delegate_; | 74 component_action_delegate_; |
| 72 | 75 |
| 73 // Responsible for changing the pref to always show or hide component actions. | 76 // Responsible for changing the pref to always show or hide component actions. |
| 74 // It is owned by ToolbarActionsModel and outlives |this|. | 77 // It is owned by ToolbarActionsModel and outlives |this|. |
| 75 ComponentMigrationHelper* const component_migration_helper_; | 78 ComponentMigrationHelper* const component_migration_helper_; |
| 76 | 79 |
| 77 bool has_issue_ = false; | 80 bool has_issue_ = false; |
| 78 bool has_local_display_route_ = false; | 81 bool has_local_display_route_ = false; |
| 79 | 82 |
| 83 // Whether the media router action is shown by an administrator policy. |
| 84 bool shown_by_policy_; |
| 85 |
| 80 // The number of dialogs that are currently open. | 86 // The number of dialogs that are currently open. |
| 81 size_t dialog_count_ = 0; | 87 size_t dialog_count_ = 0; |
| 82 | 88 |
| 83 PrefChangeRegistrar pref_change_registrar_; | 89 PrefChangeRegistrar pref_change_registrar_; |
| 84 | 90 |
| 85 DISALLOW_COPY_AND_ASSIGN(MediaRouterActionController); | 91 DISALLOW_COPY_AND_ASSIGN(MediaRouterActionController); |
| 86 }; | 92 }; |
| 87 | 93 |
| 88 #endif // CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_CONTROLLER_H_ | 94 #endif // CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_CONTROLLER_H_ |
| OLD | NEW |