| Index: chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc
|
| diff --git a/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc b/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc
|
| index 72a0087d5d271959d231337784922b9b6269031c..37e6ddc4398369a1ac5a3ed3d43ca5806db34b3d 100644
|
| --- a/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc
|
| +++ b/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc
|
| @@ -56,11 +56,7 @@ namespace local_discovery {
|
| namespace {
|
| const char kPrivetAutomatedClaimURLFormat[] = "%s/confirm?token=%s";
|
|
|
| -const int kInitialRequeryTimeSeconds = 1;
|
| -const int kMaxRequeryTimeSeconds = 2; // Time for last requery
|
| -
|
| int g_num_visible = 0;
|
| -
|
| } // namespace
|
|
|
| LocalDiscoveryUIHandler::LocalDiscoveryUIHandler() : is_visible_(false) {
|
| @@ -143,7 +139,7 @@ void LocalDiscoveryUIHandler::HandleStart(const base::ListValue* args) {
|
| }
|
|
|
| privet_lister_->Start();
|
| - SendQuery(kInitialRequeryTimeSeconds);
|
| + privet_lister_->DiscoverNewDevices(false);
|
|
|
| #if defined(CLOUD_PRINT_CONNECTOR_UI_AVAILABLE)
|
| StartCloudPrintConnector();
|
| @@ -383,7 +379,7 @@ void LocalDiscoveryUIHandler::DeviceRemoved(const std::string& name) {
|
|
|
| void LocalDiscoveryUIHandler::DeviceCacheFlushed() {
|
| web_ui()->CallJavascriptFunction("local_discovery.onDeviceCacheFlushed");
|
| - SendQuery(kInitialRequeryTimeSeconds);
|
| + privet_lister_->DiscoverNewDevices(false);
|
| }
|
|
|
| void LocalDiscoveryUIHandler::OnCloudPrintPrinterListReady() {
|
| @@ -506,24 +502,6 @@ void LocalDiscoveryUIHandler::CheckUserLoggedIn() {
|
| logged_in_value);
|
| }
|
|
|
| -void LocalDiscoveryUIHandler::ScheduleQuery(int timeout_seconds) {
|
| - if (timeout_seconds <= kMaxRequeryTimeSeconds) {
|
| - requery_callback_.Reset(base::Bind(&LocalDiscoveryUIHandler::SendQuery,
|
| - base::Unretained(this),
|
| - timeout_seconds * 2));
|
| -
|
| - base::MessageLoop::current()->PostDelayedTask(
|
| - FROM_HERE,
|
| - requery_callback_.callback(),
|
| - base::TimeDelta::FromSeconds(timeout_seconds));
|
| - }
|
| -}
|
| -
|
| -void LocalDiscoveryUIHandler::SendQuery(int next_timeout_seconds) {
|
| - privet_lister_->DiscoverNewDevices(false);
|
| - ScheduleQuery(next_timeout_seconds);
|
| -}
|
| -
|
| #if defined(CLOUD_PRINT_CONNECTOR_UI_AVAILABLE)
|
| void LocalDiscoveryUIHandler::StartCloudPrintConnector() {
|
| Profile* profile = Profile::FromWebUI(web_ui());
|
|
|