Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager_util.cc

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix new addition Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 = ash::Shell::GetScreen()->GetPrimaryDisplay().size();
525 const gfx::Rect bounds((screen.width() - kDialogWidth) / 2, 526 const gfx::Rect bounds((screen.width() - kDialogWidth) / 2,
526 (screen.height() - kDialogHeight) / 2, 527 (screen.height() - kDialogHeight) / 2,
527 kDialogWidth, 528 kDialogWidth,
528 kDialogHeight); 529 kDialogHeight);
529 530
530 Browser* browser = GetBrowserForUrl(dialog_url); 531 Browser* browser = GetBrowserForUrl(dialog_url);
531 532
532 if (!browser) { 533 if (!browser) {
533 browser = new Browser( 534 browser = new Browser(
534 Browser::CreateParams::CreateForApp(Browser::TYPE_POPUP, 535 Browser::CreateParams::CreateForApp(Browser::TYPE_POPUP,
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 scoped_ptr<ListValue> result_list(new ListValue()); 811 scoped_ptr<ListValue> result_list(new ListValue());
811 for (gdata::OperationProgressStatusList::const_iterator iter = list.begin(); 812 for (gdata::OperationProgressStatusList::const_iterator iter = list.begin();
812 iter != list.end(); ++iter) { 813 iter != list.end(); ++iter) {
813 result_list->Append( 814 result_list->Append(
814 ProgessStatusToDictionaryValue(profile, origin_url, *iter)); 815 ProgessStatusToDictionaryValue(profile, origin_url, *iter));
815 } 816 }
816 return result_list.release(); 817 return result_list.release();
817 } 818 }
818 819
819 } // namespace file_manager_util 820 } // namespace file_manager_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698