| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h" | 5 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 void LocalDiscoveryUIHandler::SetIsVisible(bool visible) { | 470 void LocalDiscoveryUIHandler::SetIsVisible(bool visible) { |
| 471 if (visible != is_visible_) { | 471 if (visible != is_visible_) { |
| 472 g_num_visible += visible ? 1 : -1; | 472 g_num_visible += visible ? 1 : -1; |
| 473 is_visible_ = visible; | 473 is_visible_ = visible; |
| 474 } | 474 } |
| 475 } | 475 } |
| 476 | 476 |
| 477 std::string LocalDiscoveryUIHandler::GetSyncAccount() { | 477 std::string LocalDiscoveryUIHandler::GetSyncAccount() { |
| 478 Profile* profile = Profile::FromWebUI(web_ui()); | 478 Profile* profile = Profile::FromWebUI(web_ui()); |
| 479 SigninManagerBase* signin_manager = | 479 SigninManagerBase* signin_manager = |
| 480 SigninManagerFactory::GetForProfileIfExists(profile); | 480 SigninManagerFactory::GetForBrowserContextIfExists(profile); |
| 481 | 481 |
| 482 if (!signin_manager) { | 482 if (!signin_manager) { |
| 483 return ""; | 483 return ""; |
| 484 } | 484 } |
| 485 | 485 |
| 486 return signin_manager->GetAuthenticatedUsername(); | 486 return signin_manager->GetAuthenticatedUsername(); |
| 487 } | 487 } |
| 488 | 488 |
| 489 std::string LocalDiscoveryUIHandler::GetCloudPrintBaseUrl() { | 489 std::string LocalDiscoveryUIHandler::GetCloudPrintBaseUrl() { |
| 490 CloudPrintURL cloud_print_url(Profile::FromWebUI(web_ui())); | 490 CloudPrintURL cloud_print_url(Profile::FromWebUI(web_ui())); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 } | 636 } |
| 637 | 637 |
| 638 void LocalDiscoveryUIHandler::RefreshCloudPrintStatusFromService() { | 638 void LocalDiscoveryUIHandler::RefreshCloudPrintStatusFromService() { |
| 639 if (cloud_print_connector_ui_enabled_) | 639 if (cloud_print_connector_ui_enabled_) |
| 640 CloudPrintProxyServiceFactory::GetForProfile(Profile::FromWebUI(web_ui()))-> | 640 CloudPrintProxyServiceFactory::GetForProfile(Profile::FromWebUI(web_ui()))-> |
| 641 RefreshStatusFromService(); | 641 RefreshStatusFromService(); |
| 642 } | 642 } |
| 643 #endif // cloud print connector option stuff | 643 #endif // cloud print connector option stuff |
| 644 | 644 |
| 645 } // namespace local_discovery | 645 } // namespace local_discovery |
| OLD | NEW |