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 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 SetupCloudPrintConnectorSection(); | 554 SetupCloudPrintConnectorSection(); |
555 } | 555 } |
556 | 556 |
557 void LocalDiscoveryUIHandler::ShowCloudPrintSetupDialog( | 557 void LocalDiscoveryUIHandler::ShowCloudPrintSetupDialog( |
558 const base::ListValue* args) { | 558 const base::ListValue* args) { |
559 content::RecordAction( | 559 content::RecordAction( |
560 base::UserMetricsAction("Options_EnableCloudPrintProxy")); | 560 base::UserMetricsAction("Options_EnableCloudPrintProxy")); |
561 // Open the connector enable page in the current tab. | 561 // Open the connector enable page in the current tab. |
562 content::OpenURLParams params(cloud_devices::GetCloudPrintEnableURL( | 562 content::OpenURLParams params(cloud_devices::GetCloudPrintEnableURL( |
563 GetCloudPrintProxyService()->proxy_id()), | 563 GetCloudPrintProxyService()->proxy_id()), |
564 content::Referrer(), CURRENT_TAB, | 564 content::Referrer(), |
| 565 WindowOpenDisposition::CURRENT_TAB, |
565 ui::PAGE_TRANSITION_LINK, false); | 566 ui::PAGE_TRANSITION_LINK, false); |
566 web_ui()->GetWebContents()->OpenURL(params); | 567 web_ui()->GetWebContents()->OpenURL(params); |
567 } | 568 } |
568 | 569 |
569 void LocalDiscoveryUIHandler::HandleDisableCloudPrintConnector( | 570 void LocalDiscoveryUIHandler::HandleDisableCloudPrintConnector( |
570 const base::ListValue* args) { | 571 const base::ListValue* args) { |
571 content::RecordAction( | 572 content::RecordAction( |
572 base::UserMetricsAction("Options_DisableCloudPrintProxy")); | 573 base::UserMetricsAction("Options_DisableCloudPrintProxy")); |
573 GetCloudPrintProxyService()->DisableForUser(); | 574 GetCloudPrintProxyService()->DisableForUser(); |
574 } | 575 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 service->RefreshStatusFromService(); | 612 service->RefreshStatusFromService(); |
612 } | 613 } |
613 | 614 |
614 CloudPrintProxyService* LocalDiscoveryUIHandler::GetCloudPrintProxyService() { | 615 CloudPrintProxyService* LocalDiscoveryUIHandler::GetCloudPrintProxyService() { |
615 return CloudPrintProxyServiceFactory::GetForProfile( | 616 return CloudPrintProxyServiceFactory::GetForProfile( |
616 Profile::FromWebUI(web_ui())); | 617 Profile::FromWebUI(web_ui())); |
617 } | 618 } |
618 #endif // defined(CLOUD_PRINT_CONNECTOR_UI_AVAILABLE) | 619 #endif // defined(CLOUD_PRINT_CONNECTOR_UI_AVAILABLE) |
619 | 620 |
620 } // namespace local_discovery | 621 } // namespace local_discovery |
OLD | NEW |