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

Side by Side Diff: extensions/browser/guest_view/web_view/web_view_guest.h

Issue 885493007: Refactoring: de-couple Extensions from "script injection System" [render side] : 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Devlin's comments. Created 5 years, 10 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_
6 #define EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h"
10 #include "base/observer_list.h" 11 #include "base/observer_list.h"
11 #include "content/public/browser/javascript_dialog_manager.h" 12 #include "content/public/browser/javascript_dialog_manager.h"
12 #include "content/public/browser/notification_observer.h" 13 #include "content/public/browser/notification_observer.h"
13 #include "content/public/browser/notification_registrar.h" 14 #include "content/public/browser/notification_registrar.h"
14 #include "extensions/browser/guest_view/guest_view.h" 15 #include "extensions/browser/guest_view/guest_view.h"
15 #include "extensions/browser/guest_view/web_view/javascript_dialog_helper.h" 16 #include "extensions/browser/guest_view/web_view/javascript_dialog_helper.h"
16 #include "extensions/browser/guest_view/web_view/web_view_find_helper.h" 17 #include "extensions/browser/guest_view/web_view/web_view_find_helper.h"
17 #include "extensions/browser/guest_view/web_view/web_view_guest_delegate.h" 18 #include "extensions/browser/guest_view/web_view/web_view_guest_delegate.h"
18 #include "extensions/browser/guest_view/web_view/web_view_permission_helper.h" 19 #include "extensions/browser/guest_view/web_view/web_view_permission_helper.h"
19 #include "extensions/browser/guest_view/web_view/web_view_permission_types.h" 20 #include "extensions/browser/guest_view/web_view/web_view_permission_types.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 static int GetViewInstanceId(content::WebContents* contents); 56 static int GetViewInstanceId(content::WebContents* contents);
56 57
57 static const char Type[]; 58 static const char Type[];
58 59
59 // Return the stored rules registry ID of the given webview. Will generate 60 // Return the stored rules registry ID of the given webview. Will generate
60 // an ID for the first query. 61 // an ID for the first query.
61 static int GetOrGenerateRulesRegistryID( 62 static int GetOrGenerateRulesRegistryID(
62 int embedder_process_id, 63 int embedder_process_id,
63 int web_view_instance_id); 64 int web_view_instance_id);
64 65
66 // Return the stored script injection instance ID of the given guest.
67 // Will generate an ID for the first query.
68 static int GetOrGenerateScriptInjectionInstanceID(
69 int embedder_process_id,
70 int guest_instance_id);
71
65 // Request navigating the guest to the provided |src| URL. 72 // Request navigating the guest to the provided |src| URL.
66 void NavigateGuest(const std::string& src, bool force_navigation); 73 void NavigateGuest(const std::string& src, bool force_navigation);
67 74
68 // Shows the context menu for the guest. 75 // Shows the context menu for the guest.
69 // |items| acts as a filter. This restricts the current context's default 76 // |items| acts as a filter. This restricts the current context's default
70 // menu items to contain only the items from |items|. 77 // menu items to contain only the items from |items|.
71 // |items| == NULL means no filtering will be applied. 78 // |items| == NULL means no filtering will be applied.
72 void ShowContextMenu( 79 void ShowContextMenu(
73 int request_id, 80 int request_id,
74 const WebViewGuestDelegate::MenuItemVector* items); 81 const WebViewGuestDelegate::MenuItemVector* items);
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 // This is used to ensure pending tasks will not fire after this object is 372 // This is used to ensure pending tasks will not fire after this object is
366 // destroyed. 373 // destroyed.
367 base::WeakPtrFactory<WebViewGuest> weak_ptr_factory_; 374 base::WeakPtrFactory<WebViewGuest> weak_ptr_factory_;
368 375
369 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); 376 DISALLOW_COPY_AND_ASSIGN(WebViewGuest);
370 }; 377 };
371 378
372 } // namespace extensions 379 } // namespace extensions
373 380
374 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ 381 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698