1 // Copyright 2015 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.
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_INSPECTABLE_VIEWS_FINDER_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_INSPECTABLE_VIEWS_FINDER_H_
10 #include "base/macros.h"
11 #include "base/memory/linked_ptr.h"
12 #include "extensions/common/view_type.h"
17 namespace extensions
{
22 namespace developer_private
{
27 // Finds inspectable views for the extensions, and returns them as represented
28 // by the developerPrivate API structure and schema compiler.
29 class InspectableViewsFinder
{
31 using View
= linked_ptr
<api::developer_private::ExtensionView
>;
32 using ViewList
= std::vector
<View
>;
34 explicit InspectableViewsFinder(Profile
* profile
);
35 ~InspectableViewsFinder();
37 // Construct a view from the given parameters.
38 static View
ConstructView(const GURL
& url
,
39 int render_process_id
,
44 // Return a list of inspectable views for the given |extension|.
45 ViewList
GetViewsForExtension(const Extension
& extension
, bool is_enabled
);
48 // Returns all inspectable views for a given |profile|.
49 void GetViewsForExtensionForProfile(const Extension
& extension
,
55 // Returns all inspectable views for the extension process.
56 void GetViewsForExtensionProcess(
57 const Extension
& extension
,
58 ProcessManager
* process_manager
,
62 // Returns all inspectable app views for the extension.
63 void GetAppWindowViewsForExtension(const Extension
& extension
,
68 DISALLOW_COPY_AND_ASSIGN(InspectableViewsFinder
);
71 } // namespace extensions
73 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_INSPECTABLE_VIEWS_FINDER_H_