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

Side by Side Diff: chrome/browser/chromeos/file_manager/arc_file_tasks.cc

Issue 2133503002: arc: Revamp the ArcBridgeService interface (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: More rebasing Created 4 years, 5 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
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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/chromeos/file_manager/arc_file_tasks.h" 5 #include "chrome/browser/chromeos/file_manager/arc_file_tasks.h"
6 6
7 #include <map>
7 #include <memory> 8 #include <memory>
8 #include <string> 9 #include <string>
9 #include <vector> 10 #include <vector>
10 11
11 #include "base/base64.h" 12 #include "base/base64.h"
12 #include "base/bind.h" 13 #include "base/bind.h"
13 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
14 #include "base/logging.h" 15 #include "base/logging.h"
15 #include "base/strings/utf_string_conversions.h" 16 #include "base/strings/utf_string_conversions.h"
16 #include "base/threading/thread_restrictions.h" 17 #include "base/threading/thread_restrictions.h"
(...skipping 28 matching lines...) Expand all
45 constexpr base::FilePath::CharType kRemovableMediaPath[] = 46 constexpr base::FilePath::CharType kRemovableMediaPath[] =
46 FILE_PATH_LITERAL("/media/removable"); 47 FILE_PATH_LITERAL("/media/removable");
47 constexpr char kArcRemovableMediaProviderUrl[] = 48 constexpr char kArcRemovableMediaProviderUrl[] =
48 "content://org.chromium.arc.removablemediaprovider/"; 49 "content://org.chromium.arc.removablemediaprovider/";
49 constexpr char kAppIdSeparator = '/'; 50 constexpr char kAppIdSeparator = '/';
50 constexpr char kPngDataUrlPrefix[] = "data:image/png;base64,"; 51 constexpr char kPngDataUrlPrefix[] = "data:image/png;base64,";
51 52
52 // Returns the Mojo interface for ARC Intent Helper, with version |minVersion| 53 // Returns the Mojo interface for ARC Intent Helper, with version |minVersion|
53 // or above. If the ARC bridge is not established, returns null. 54 // or above. If the ARC bridge is not established, returns null.
54 arc::mojom::IntentHelperInstance* GetArcIntentHelper(Profile* profile, 55 arc::mojom::IntentHelperInstance* GetArcIntentHelper(Profile* profile,
55 int min_version) { 56 uint32_t min_version) {
56 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 57 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
57 58
58 // File manager in secondary profile cannot access ARC. 59 // File manager in secondary profile cannot access ARC.
59 if (!chromeos::ProfileHelper::IsPrimaryProfile(profile)) 60 if (!chromeos::ProfileHelper::IsPrimaryProfile(profile))
60 return nullptr; 61 return nullptr;
61 62
62 arc::ArcBridgeService* arc_service = arc::ArcBridgeService::Get(); 63 arc::ArcBridgeService* arc_service = arc::ArcBridgeService::Get();
63 if (!arc_service) 64 if (!arc_service)
64 return nullptr; 65 return nullptr;
65 66
66 arc::mojom::IntentHelperInstance* intent_helper_instance = 67 arc::mojom::IntentHelperInstance* intent_helper_instance =
67 arc_service->intent_helper_instance(); 68 arc_service->intent_helper()->instance();
68 if (!intent_helper_instance) 69 if (!intent_helper_instance)
69 return nullptr; 70 return nullptr;
70 71
71 if (arc_service->intent_helper_version() < min_version) { 72 if (arc_service->intent_helper()->version() < min_version) {
72 DLOG(WARNING) << "ARC intent helper instance is too old."; 73 DLOG(WARNING) << "ARC intent helper instance is too old.";
73 return nullptr; 74 return nullptr;
74 } 75 }
75 return intent_helper_instance; 76 return intent_helper_instance;
76 } 77 }
77 78
78 // Returns the icon loader that wraps the Mojo interface for ARC Intent Helper. 79 // Returns the icon loader that wraps the Mojo interface for ARC Intent Helper.
79 scoped_refptr<arc::ActivityIconLoader> GetArcActivityIconLoader() { 80 scoped_refptr<arc::ActivityIconLoader> GetArcActivityIconLoader() {
80 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 81 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
81 82
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 } else { 349 } else {
349 arc_intent_helper->HandleUrlListDeprecated( 350 arc_intent_helper->HandleUrlListDeprecated(
350 std::move(urls), AppIdToActivityName(task.app_id)->package_name, 351 std::move(urls), AppIdToActivityName(task.app_id)->package_name,
351 StringToArcAction(task.action_id)); 352 StringToArcAction(task.action_id));
352 } 353 }
353 return true; 354 return true;
354 } 355 }
355 356
356 } // namespace file_tasks 357 } // namespace file_tasks
357 } // namespace file_manager 358 } // namespace file_manager
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/arc/gpu_arc_video_service_host.cc ('k') | chrome/browser/memory/tab_manager_delegate_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698