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

Side by Side Diff: components/arc/intent_helper/link_handler_model_impl.h

Issue 1760773004: Add "Open with <ARC-app-name>" items to the context menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address dcheng's comment Created 4 years, 8 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_ARC_INTENT_HELPER_LINK_HANDLER_MODEL_IMPL_H_
6 #define COMPONENTS_ARC_INTENT_HELPER_LINK_HANDLER_MODEL_IMPL_H_
7
8 #include "ash/link_handler_model.h"
9 #include "base/memory/weak_ptr.h"
10 #include "components/arc/arc_service.h"
11 #include "components/arc/common/intent_helper.mojom.h"
12
13 namespace arc {
14
15 class LinkHandlerModelImpl : public ash::LinkHandlerModel {
16 public:
17 LinkHandlerModelImpl();
18 ~LinkHandlerModelImpl() override;
19
20 // ash::LinkHandlerModel overrides:
21 void AddObserver(Observer* observer) override;
22 void OpenLinkWithHandler(const GURL& url, uint32_t handler_id) override;
23
24 // Starts retrieving handler information for the |url| and returns true.
25 // Returns false when the information cannot be retrieved. In that case,
26 // the caller should delete |this| object.
27 bool Init(const GURL& url);
28
29 private:
30 mojom::IntentHelperInstance* GetIntentHelper();
31 void OnUrlHandlerList(mojo::Array<mojom::UrlHandlerInfoPtr> handlers);
32 void NotifyObserver();
33
34 Observer* observer_;
35 mojo::Array<mojom::UrlHandlerInfoPtr> handlers_;
36
37 // Always keep this the last member of this class to make sure it's the
38 // first thing to be destructed.
39 base::WeakPtrFactory<LinkHandlerModelImpl> weak_ptr_factory_;
40
41 DISALLOW_COPY_AND_ASSIGN(LinkHandlerModelImpl);
42 };
43
44 } // namespace arc
45
46 #endif // COMPONENTS_ARC_INTENT_HELPER_LINK_HANDLER_MODEL_IMPL_H_
OLDNEW
« no previous file with comments | « components/arc/intent_helper/arc_intent_helper_bridge.cc ('k') | components/arc/intent_helper/link_handler_model_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698