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

Side by Side Diff: chrome/browser/chromeos/accessibility/accessibility_extension_loader.h

Issue 2212863002: Factor the extension loading code out of AccessibilityManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no_load_chromevox
Patch Set: Rebase on modified component loader patch Created 4 years, 4 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 CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_EXTENSION_LOADER_H_
6 #define CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_EXTENSION_LOADER_H_
7
8 #include "base/callback_forward.h"
9 #include "base/files/file_path.h"
10 #include "base/memory/weak_ptr.h"
11
12 namespace content {
13 class RenderViewHost;
14 }
15
16 class ExtensionService;
17 class Profile;
18
19 namespace chromeos {
20
21 class AccessibilityExtensionLoader {
David Tseng 2016/08/11 22:22:13 Please include a small description of the class.
22 public:
23 AccessibilityExtensionLoader(const std::string& extension_id,
24 const base::FilePath& extension_path);
25 ~AccessibilityExtensionLoader();
26
27 void SetProfile(Profile* profile);
28 void Load(Profile* profile,
29 const std::string& init_script_str,
30 const base::Closure& done_cb);
31 void Unload();
David Tseng 2016/08/11 22:22:13 I'm not entirely sure about the use of SetProfile
32 void LoadToUserScreen(const base::Closure& done_cb);
33 void LoadToLockScreen(const base::Closure& done_cb);
34 void InjectContentScript(content::RenderViewHost* render_view_host);
35
36 bool loaded_on_lock_screen() { return loaded_on_lock_screen_; }
37
38 private:
39 void InjectContentScriptAndCallback(ExtensionService* extension_service,
40 int render_process_id,
41 int render_view_id,
42 const base::Closure& done_cb);
43 void LoadExtension(Profile* profile,
44 content::RenderViewHost* render_view_host,
45 base::Closure done_cb);
46
47 void UnloadFromLockScreen();
48 void UnloadExtensionFromProfile(Profile* profile);
49
50 Profile* profile_;
51 std::string extension_id_;
52 base::FilePath extension_path_;
53 std::string init_script_str_;
54
55 // Profile which the extension is currently loaded to.
56 // If nullptr, it is not loaded to any profile.
57 bool loaded_on_lock_screen_;
58 bool loaded_on_user_screen_;
59
60 base::WeakPtrFactory<AccessibilityExtensionLoader> weak_ptr_factory_;
61
62 DISALLOW_COPY_AND_ASSIGN(AccessibilityExtensionLoader);
63 };
64
65 } // namespace chromeos
66
67 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_EXTENSION_LOADER_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698