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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 #endif | 52 #endif |
53 | 53 |
54 namespace local_discovery { | 54 namespace local_discovery { |
55 | 55 |
56 namespace { | 56 namespace { |
57 const char kPrivetAutomatedClaimURLFormat[] = "%s/confirm?token=%s"; | 57 const char kPrivetAutomatedClaimURLFormat[] = "%s/confirm?token=%s"; |
58 const int kRegistrationAnnouncementTimeoutSeconds = 5; | 58 const int kRegistrationAnnouncementTimeoutSeconds = 5; |
59 | 59 |
60 const int kInitialRequeryTimeSeconds = 1; | 60 const int kInitialRequeryTimeSeconds = 1; |
61 const int kMaxRequeryTimeSeconds = 2; // Time for last requery | 61 const int kMaxRequeryTimeSeconds = 2; // Time for last requery |
62 const int kRequeryExpontentialGrowthBase = 2; | |
63 | 62 |
64 int g_num_visible = 0; | 63 int g_num_visible = 0; |
65 | 64 |
66 } // namespace | 65 } // namespace |
67 | 66 |
68 LocalDiscoveryUIHandler::LocalDiscoveryUIHandler() : is_visible_(false) { | 67 LocalDiscoveryUIHandler::LocalDiscoveryUIHandler() : is_visible_(false) { |
69 #if defined(CLOUD_PRINT_CONNECTOR_UI_AVAILABLE) | 68 #if defined(CLOUD_PRINT_CONNECTOR_UI_AVAILABLE) |
70 #if !defined(GOOGLE_CHROME_BUILD) && defined(OS_WIN) | 69 #if !defined(GOOGLE_CHROME_BUILD) && defined(OS_WIN) |
71 // On Windows, we need the PDF plugin which is only guaranteed to exist on | 70 // On Windows, we need the PDF plugin which is only guaranteed to exist on |
72 // Google Chrome builds. Use a command-line switch for Windows non-Google | 71 // Google Chrome builds. Use a command-line switch for Windows non-Google |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 } | 636 } |
638 | 637 |
639 void LocalDiscoveryUIHandler::RefreshCloudPrintStatusFromService() { | 638 void LocalDiscoveryUIHandler::RefreshCloudPrintStatusFromService() { |
640 if (cloud_print_connector_ui_enabled_) | 639 if (cloud_print_connector_ui_enabled_) |
641 CloudPrintProxyServiceFactory::GetForProfile(Profile::FromWebUI(web_ui()))-> | 640 CloudPrintProxyServiceFactory::GetForProfile(Profile::FromWebUI(web_ui()))-> |
642 RefreshStatusFromService(); | 641 RefreshStatusFromService(); |
643 } | 642 } |
644 #endif // cloud print connector option stuff | 643 #endif // cloud print connector option stuff |
645 | 644 |
646 } // namespace local_discovery | 645 } // namespace local_discovery |
OLD | NEW |