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

Side by Side Diff: content/renderer/browser_plugin/browser_plugin.h

Issue 11092023: Browser Plugin: Implement CanGoBack/CanGoForward (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ 5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_
6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_
7 7
8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h"
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 22 matching lines...) Expand all
33 // Get the src attribute value of the BrowserPlugin instance if the guest 33 // Get the src attribute value of the BrowserPlugin instance if the guest
34 // has not crashed. 34 // has not crashed.
35 std::string GetSrcAttribute() const; 35 std::string GetSrcAttribute() const;
36 // Set the src attribute value of the BrowserPlugin instance and reset 36 // Set the src attribute value of the BrowserPlugin instance and reset
37 // the guest_crashed_ flag. 37 // the guest_crashed_ flag.
38 void SetSrcAttribute(const std::string& src); 38 void SetSrcAttribute(const std::string& src);
39 // Returns Chrome's process ID for the current guest. 39 // Returns Chrome's process ID for the current guest.
40 int process_id() const { return process_id_; } 40 int process_id() const { return process_id_; }
41 // The partition identifier string is stored as UTF-8. 41 // The partition identifier string is stored as UTF-8.
42 std::string GetPartitionAttribute() const; 42 std::string GetPartitionAttribute() const;
43 // Query whether the guest can navigate back to the previous entry.
44 bool CanGoBack() const;
45 // Query whether the guest can navigation forward to the next entry.
46 bool CanGoForward() const;
43 // This method can be successfully called only before the first navigation for 47 // This method can be successfully called only before the first navigation for
44 // this instance of BrowserPlugin. If an error occurs, the |error_message| is 48 // this instance of BrowserPlugin. If an error occurs, the |error_message| is
45 // set appropriately to indicate the failure reason. 49 // set appropriately to indicate the failure reason.
46 bool SetPartitionAttribute(const std::string& partition_id, 50 bool SetPartitionAttribute(const std::string& partition_id,
47 std::string& error_message); 51 std::string& error_message);
48 52
49 // Inform the BrowserPlugin to update its backing store with the pixels in 53 // Inform the BrowserPlugin to update its backing store with the pixels in
50 // its damage buffer. 54 // its damage buffer.
51 void UpdateRect(int message_id, 55 void UpdateRect(int message_id,
52 const BrowserPluginMsg_UpdateRect_Params& params); 56 const BrowserPluginMsg_UpdateRect_Params& params);
53 // Inform the BrowserPlugin that its guest has crashed. 57 // Inform the BrowserPlugin that its guest has crashed.
54 void GuestCrashed(); 58 void GuestCrashed();
55 // Informs the BrowserPlugin that the guest has navigated to a new URL. 59 // Informs the BrowserPlugin that the guest has navigated to a new URL.
56 void DidNavigate(const GURL& url, int process_id); 60 void DidNavigate(const GURL& url, int process_id);
61 // Informs the BrowserPlugin that the guest's navigation state has changed.
62 void NavigationStateUpdate(int current_entry_index, int entry_count);
Charlie Reis 2012/10/10 06:06:53 Seems like this can just be merged into DidNavigat
Fady Samuel 2012/10/10 17:36:44 Done.
57 // Inform the BrowserPlugin that the guest has started loading a new page. 63 // Inform the BrowserPlugin that the guest has started loading a new page.
58 void LoadStart(const GURL& url, bool is_top_level); 64 void LoadStart(const GURL& url, bool is_top_level);
59 // Inform the BrowserPlugin that the guest has aborted loading a new page. 65 // Inform the BrowserPlugin that the guest has aborted loading a new page.
60 void LoadAbort(const GURL& url, bool is_top_level, const std::string& type); 66 void LoadAbort(const GURL& url, bool is_top_level, const std::string& type);
61 // Inform the BrowserPlugin that the guest has redirected a navigation. 67 // Inform the BrowserPlugin that the guest has redirected a navigation.
62 void LoadRedirect(const GURL& old_url, 68 void LoadRedirect(const GURL& old_url,
63 const GURL& new_url, 69 const GURL& new_url,
64 bool is_top_level); 70 bool is_top_level);
65 // Tells the BrowserPlugin to advance the focus to the next (or previous) 71 // Tells the BrowserPlugin to advance the focus to the next (or previous)
66 // element. 72 // element.
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 bool persist_storage_; 199 bool persist_storage_;
194 // Tracks the visibility of the browser plugin regardless of the whole 200 // Tracks the visibility of the browser plugin regardless of the whole
195 // embedder RenderView's visibility. 201 // embedder RenderView's visibility.
196 bool visible_; 202 bool visible_;
197 typedef std::vector<v8::Persistent<v8::Function> > EventListeners; 203 typedef std::vector<v8::Persistent<v8::Function> > EventListeners;
198 typedef std::map<std::string, EventListeners> EventListenerMap; 204 typedef std::map<std::string, EventListeners> EventListenerMap;
199 EventListenerMap event_listener_map_; 205 EventListenerMap event_listener_map_;
200 #if defined(OS_WIN) 206 #if defined(OS_WIN)
201 base::SharedMemory shared_memory_; 207 base::SharedMemory shared_memory_;
202 #endif 208 #endif
209 int current_nav_entry_index_;
210 int nav_entry_count_;
Charlie Reis 2012/10/10 06:06:53 I get really scared by keeping this state here, bu
Fady Samuel 2012/10/10 17:36:44 Done.
203 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); 211 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin);
204 }; 212 };
205 213
206 } // namespace content 214 } // namespace content
207 215
208 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ 216 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698