| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/net_export_ui.h" | 5 #include "chrome/browser/ui/webui/net_export_ui.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 return true; | 326 return true; |
| 327 #else | 327 #else |
| 328 return false; | 328 return false; |
| 329 #endif | 329 #endif |
| 330 } | 330 } |
| 331 | 331 |
| 332 void NetExportMessageHandler::NotifyUIWithState( | 332 void NetExportMessageHandler::NotifyUIWithState( |
| 333 std::unique_ptr<base::DictionaryValue> state) { | 333 std::unique_ptr<base::DictionaryValue> state) { |
| 334 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 334 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 335 DCHECK(web_ui()); | 335 DCHECK(web_ui()); |
| 336 state->SetBoolean("useMobileUI", UsingMobileUI()); | |
| 337 web_ui()->CallJavascriptFunctionUnsafe(net_log::kOnExportNetLogInfoChanged, | 336 web_ui()->CallJavascriptFunctionUnsafe(net_log::kOnExportNetLogInfoChanged, |
| 338 *state); | 337 *state); |
| 339 } | 338 } |
| 340 | 339 |
| 341 void NetExportMessageHandler::ShowSelectFileDialog( | 340 void NetExportMessageHandler::ShowSelectFileDialog( |
| 342 const base::FilePath& default_path) { | 341 const base::FilePath& default_path) { |
| 343 // User may have clicked more than once before the save dialog appears. | 342 // User may have clicked more than once before the save dialog appears. |
| 344 // This prevents creating more than one save dialog. | 343 // This prevents creating more than one save dialog. |
| 345 if (select_file_dialog_) | 344 if (select_file_dialog_) |
| 346 return; | 345 return; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 | 381 |
| 383 } // namespace | 382 } // namespace |
| 384 | 383 |
| 385 NetExportUI::NetExportUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 384 NetExportUI::NetExportUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
| 386 web_ui->AddMessageHandler(base::MakeUnique<NetExportMessageHandler>()); | 385 web_ui->AddMessageHandler(base::MakeUnique<NetExportMessageHandler>()); |
| 387 | 386 |
| 388 // Set up the chrome://net-export/ source. | 387 // Set up the chrome://net-export/ source. |
| 389 Profile* profile = Profile::FromWebUI(web_ui); | 388 Profile* profile = Profile::FromWebUI(web_ui); |
| 390 content::WebUIDataSource::Add(profile, CreateNetExportHTMLSource()); | 389 content::WebUIDataSource::Add(profile, CreateNetExportHTMLSource()); |
| 391 } | 390 } |
| OLD | NEW |