| 
									
										
										
										
											2014-10-31 11:17:05 -07:00
										 |  |  | // Copyright (c) 2014 GitHub, Inc.
 | 
					
						
							| 
									
										
										
										
											2014-06-16 14:27:57 +08:00
										 |  |  | // Use of this source code is governed by the MIT license that can be
 | 
					
						
							|  |  |  | // found in the LICENSE file.
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-24 18:24:12 +08:00
										 |  |  | #ifndef ATOM_RENDERER_API_ATOM_API_WEB_FRAME_H_
 | 
					
						
							|  |  |  | #define ATOM_RENDERER_API_ATOM_API_WEB_FRAME_H_
 | 
					
						
							| 
									
										
										
										
											2014-06-16 14:27:57 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-24 18:44:15 +08:00
										 |  |  | #include <string>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-29 13:47:09 +08:00
										 |  |  | #include "atom/renderer/guest_view_container.h"
 | 
					
						
							| 
									
										
										
										
											2014-12-18 13:54:01 -08:00
										 |  |  | #include "base/memory/scoped_ptr.h"
 | 
					
						
							| 
									
										
										
										
											2014-06-16 14:27:57 +08:00
										 |  |  | #include "native_mate/handle.h"
 | 
					
						
							|  |  |  | #include "native_mate/wrappable.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-06-28 22:33:00 +08:00
										 |  |  | namespace blink { | 
					
						
							| 
									
										
										
										
											2014-10-24 18:24:12 +08:00
										 |  |  | class WebLocalFrame; | 
					
						
							| 
									
										
										
										
											2014-06-16 14:27:57 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-19 20:42:19 -08:00
										 |  |  | namespace mate { | 
					
						
							|  |  |  | class Arguments; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-06-16 14:27:57 +08:00
										 |  |  | namespace atom { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace api { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-18 13:54:01 -08:00
										 |  |  | class SpellCheckClient; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-04-25 10:17:54 +09:00
										 |  |  | class WebFrame : public mate::Wrappable<WebFrame> { | 
					
						
							| 
									
										
										
										
											2014-06-16 14:27:57 +08:00
										 |  |  |  public: | 
					
						
							| 
									
										
										
										
											2014-10-24 18:24:12 +08:00
										 |  |  |   static mate::Handle<WebFrame> Create(v8::Isolate* isolate); | 
					
						
							| 
									
										
										
										
											2014-06-16 14:27:57 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-04-25 10:17:54 +09:00
										 |  |  |   static void BuildPrototype(v8::Isolate* isolate, | 
					
						
							|  |  |  |                              v8::Local<v8::ObjectTemplate> prototype); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-06-16 14:27:57 +08:00
										 |  |  |  private: | 
					
						
							| 
									
										
										
										
											2016-04-25 10:17:54 +09:00
										 |  |  |   explicit WebFrame(v8::Isolate* isolate); | 
					
						
							|  |  |  |   ~WebFrame() override; | 
					
						
							| 
									
										
										
										
											2014-06-16 14:27:57 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-24 18:44:15 +08:00
										 |  |  |   void SetName(const std::string& name); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-06-16 14:39:29 +08:00
										 |  |  |   double SetZoomLevel(double level); | 
					
						
							| 
									
										
										
										
											2014-06-16 14:27:57 +08:00
										 |  |  |   double GetZoomLevel() const; | 
					
						
							| 
									
										
										
										
											2014-06-16 14:39:29 +08:00
										 |  |  |   double SetZoomFactor(double factor); | 
					
						
							|  |  |  |   double GetZoomFactor() const; | 
					
						
							| 
									
										
										
										
											2014-06-16 14:27:57 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-27 22:08:25 +08:00
										 |  |  |   void SetZoomLevelLimits(double min_level, double max_level); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-22 19:11:22 +08:00
										 |  |  |   v8::Local<v8::Value> RegisterEmbedderCustomElement( | 
					
						
							|  |  |  |       const base::string16& name, v8::Local<v8::Object> options); | 
					
						
							| 
									
										
										
										
											2015-05-29 13:47:09 +08:00
										 |  |  |   void RegisterElementResizeCallback( | 
					
						
							|  |  |  |       int element_instance_id, | 
					
						
							|  |  |  |       const GuestViewContainer::ResizeCallback& callback); | 
					
						
							| 
									
										
										
										
											2014-12-08 08:05:34 -08:00
										 |  |  |   void AttachGuest(int element_instance_id); | 
					
						
							| 
									
										
										
										
											2014-10-22 21:01:12 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-18 13:54:01 -08:00
										 |  |  |   // Set the provider that will be used by SpellCheckClient for spell check.
 | 
					
						
							| 
									
										
										
										
											2014-12-19 20:42:19 -08:00
										 |  |  |   void SetSpellCheckProvider(mate::Arguments* args, | 
					
						
							|  |  |  |                              const std::string& language, | 
					
						
							| 
									
										
										
										
											2014-12-19 21:01:47 -08:00
										 |  |  |                              bool auto_spell_correct_turned_on, | 
					
						
							| 
									
										
										
										
											2015-05-22 19:11:22 +08:00
										 |  |  |                              v8::Local<v8::Object> provider); | 
					
						
							| 
									
										
										
										
											2014-12-18 13:54:01 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-29 16:50:50 +05:30
										 |  |  |   void RegisterURLSchemeAsSecure(const std::string& scheme); | 
					
						
							| 
									
										
										
										
											2015-11-13 16:03:40 +08:00
										 |  |  |   void RegisterURLSchemeAsBypassingCSP(const std::string& scheme); | 
					
						
							| 
									
										
										
										
											2015-09-21 22:59:59 +05:30
										 |  |  |   void RegisterURLSchemeAsPrivileged(const std::string& scheme); | 
					
						
							| 
									
										
										
										
											2015-07-29 16:50:50 +05:30
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-01-13 11:21:16 +08:00
										 |  |  |   // Editing.
 | 
					
						
							|  |  |  |   void InsertText(const std::string& text); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-01-13 12:11:46 +08:00
										 |  |  |   // Excecuting scripts.
 | 
					
						
							| 
									
										
										
										
											2016-01-13 12:17:56 +08:00
										 |  |  |   void ExecuteJavaScript(const base::string16& code, mate::Arguments* args); | 
					
						
							| 
									
										
										
										
											2016-01-13 12:11:46 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-18 13:54:01 -08:00
										 |  |  |   scoped_ptr<SpellCheckClient> spell_check_client_; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-24 18:24:12 +08:00
										 |  |  |   blink::WebLocalFrame* web_frame_; | 
					
						
							| 
									
										
										
										
											2014-06-16 14:27:57 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-24 18:24:12 +08:00
										 |  |  |   DISALLOW_COPY_AND_ASSIGN(WebFrame); | 
					
						
							| 
									
										
										
										
											2014-06-16 14:27:57 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | }  // namespace api
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | }  // namespace atom
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-24 18:24:12 +08:00
										 |  |  | #endif  // ATOM_RENDERER_API_ATOM_API_WEB_FRAME_H_
 |