OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/chromeos/extensions/file_manager_util.h" | 4 #include "chrome/browser/chromeos/extensions/file_manager_util.h" |
5 | 5 |
| 6 #include "ash/shell.h" |
6 #include "base/bind.h" | 7 #include "base/bind.h" |
7 #include "base/file_util.h" | 8 #include "base/file_util.h" |
8 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
9 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
10 #include "base/logging.h" | 11 #include "base/logging.h" |
11 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
12 #include "base/path_service.h" | 13 #include "base/path_service.h" |
13 #include "base/string_util.h" | 14 #include "base/string_util.h" |
14 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
15 #include "base/values.h" | 16 #include "base/values.h" |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 | 515 |
515 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); | 516 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); |
516 | 517 |
517 FilePath virtual_path; | 518 FilePath virtual_path; |
518 if (!ConvertFileToRelativeFileSystemPath(profile, path, &virtual_path)) | 519 if (!ConvertFileToRelativeFileSystemPath(profile, path, &virtual_path)) |
519 return; | 520 return; |
520 std::string url = kActionChoiceUrl; | 521 std::string url = kActionChoiceUrl; |
521 url += "#/" + net::EscapeUrlEncodedData(virtual_path.value(), false); | 522 url += "#/" + net::EscapeUrlEncodedData(virtual_path.value(), false); |
522 GURL dialog_url(url); | 523 GURL dialog_url(url); |
523 | 524 |
524 const gfx::Size screen = gfx::Screen::GetPrimaryDisplay().size(); | 525 const gfx::Size screen = |
| 526 ash::Shell::GetAshScreen()->GetPrimaryDisplay().size(); |
525 const gfx::Rect bounds((screen.width() - kDialogWidth) / 2, | 527 const gfx::Rect bounds((screen.width() - kDialogWidth) / 2, |
526 (screen.height() - kDialogHeight) / 2, | 528 (screen.height() - kDialogHeight) / 2, |
527 kDialogWidth, | 529 kDialogWidth, |
528 kDialogHeight); | 530 kDialogHeight); |
529 | 531 |
530 Browser* browser = GetBrowserForUrl(dialog_url); | 532 Browser* browser = GetBrowserForUrl(dialog_url); |
531 | 533 |
532 if (!browser) { | 534 if (!browser) { |
533 browser = new Browser( | 535 browser = new Browser( |
534 Browser::CreateParams::CreateForApp(Browser::TYPE_POPUP, | 536 Browser::CreateParams::CreateForApp(Browser::TYPE_POPUP, |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 scoped_ptr<ListValue> result_list(new ListValue()); | 812 scoped_ptr<ListValue> result_list(new ListValue()); |
811 for (gdata::OperationProgressStatusList::const_iterator iter = list.begin(); | 813 for (gdata::OperationProgressStatusList::const_iterator iter = list.begin(); |
812 iter != list.end(); ++iter) { | 814 iter != list.end(); ++iter) { |
813 result_list->Append( | 815 result_list->Append( |
814 ProgessStatusToDictionaryValue(profile, origin_url, *iter)); | 816 ProgessStatusToDictionaryValue(profile, origin_url, *iter)); |
815 } | 817 } |
816 return result_list.release(); | 818 return result_list.release(); |
817 } | 819 } |
818 | 820 |
819 } // namespace file_manager_util | 821 } // namespace file_manager_util |
OLD | NEW |