| 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/logging.h" | 5 #include "base/logging.h" |
| 6 #include "base/metrics/user_metrics.h" | 6 #include "base/metrics/user_metrics.h" |
| 7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
| 8 #include "chrome/browser/extensions/component_migration_helper.h" | 8 #include "chrome/browser/extensions/component_migration_helper.h" |
| 9 #include "chrome/browser/media/router/media_router_factory.h" | 9 #include "chrome/browser/media/router/media_router_factory.h" |
| 10 #include "chrome/browser/media/router/mojo/media_router_mojo_impl.h" | 10 #include "chrome/browser/media/router/mojo/media_router_mojo_impl.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // Cloud services preference is not set or used if the user is not signed | 76 // Cloud services preference is not set or used if the user is not signed |
| 77 // in. | 77 // in. |
| 78 SigninManagerBase* signin_manager = | 78 SigninManagerBase* signin_manager = |
| 79 SigninManagerFactory::GetForProfile(browser_->profile()); | 79 SigninManagerFactory::GetForProfile(browser_->profile()); |
| 80 return signin_manager && signin_manager->IsAuthenticated(); | 80 return signin_manager && signin_manager->IsAuthenticated(); |
| 81 } | 81 } |
| 82 #endif // defined(GOOGLE_CHROME_BUILD) | 82 #endif // defined(GOOGLE_CHROME_BUILD) |
| 83 return true; | 83 return true; |
| 84 } | 84 } |
| 85 | 85 |
| 86 bool MediaRouterContextualMenu::GetAcceleratorForCommandId( | |
| 87 int command_id, | |
| 88 ui::Accelerator* accelerator) const { | |
| 89 return false; | |
| 90 } | |
| 91 | |
| 92 void MediaRouterContextualMenu::ExecuteCommand(int command_id, | 86 void MediaRouterContextualMenu::ExecuteCommand(int command_id, |
| 93 int event_flags) { | 87 int event_flags) { |
| 94 const char kAboutPageUrl[] = | 88 const char kAboutPageUrl[] = |
| 95 "https://www.google.com/chrome/devices/chromecast/"; | 89 "https://www.google.com/chrome/devices/chromecast/"; |
| 96 const char kCastHelpCenterPageUrl[] = | 90 const char kCastHelpCenterPageUrl[] = |
| 97 "https://support.google.com/chromecast/topic/3447927"; | 91 "https://support.google.com/chromecast/topic/3447927"; |
| 98 const char kCastLearnMorePageUrl[] = | 92 const char kCastLearnMorePageUrl[] = |
| 99 "https://support.google.com/chromecast/answer/2998338"; | 93 "https://support.google.com/chromecast/answer/2998338"; |
| 100 | 94 |
| 101 #if defined(GOOGLE_CHROME_BUILD) | 95 #if defined(GOOGLE_CHROME_BUILD) |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 std::string(url::kStandardSchemeSeparator) + | 148 std::string(url::kStandardSchemeSeparator) + |
| 155 media_router->media_route_provider_extension_id() + | 149 media_router->media_route_provider_extension_id() + |
| 156 "/feedback.html"); | 150 "/feedback.html"); |
| 157 chrome::ShowSingletonTab(browser_, GURL(feedback_url)); | 151 chrome::ShowSingletonTab(browser_, GURL(feedback_url)); |
| 158 } | 152 } |
| 159 | 153 |
| 160 void MediaRouterContextualMenu::RemoveMediaRouterComponentAction() { | 154 void MediaRouterContextualMenu::RemoveMediaRouterComponentAction() { |
| 161 ToolbarActionsModel::Get(browser_->profile())->component_migration_helper() | 155 ToolbarActionsModel::Get(browser_->profile())->component_migration_helper() |
| 162 ->OnActionRemoved(ComponentToolbarActionsFactory::kMediaRouterActionId); | 156 ->OnActionRemoved(ComponentToolbarActionsFactory::kMediaRouterActionId); |
| 163 } | 157 } |
| OLD | NEW |