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

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

Issue 11554030: <webview>: Add name attribute (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added tests Created 8 years 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 23 matching lines...) Expand all
34 public: 34 public:
35 RenderViewImpl* render_view() const { return render_view_.get(); } 35 RenderViewImpl* render_view() const { return render_view_.get(); }
36 // Called only by tests to clean up before we blow away the MockRenderProcess. 36 // Called only by tests to clean up before we blow away the MockRenderProcess.
37 void Cleanup(); 37 void Cleanup();
38 38
39 // Update Browser Plugin's DOM Node attribute |attribute_name| with the value 39 // Update Browser Plugin's DOM Node attribute |attribute_name| with the value
40 // |attribute_value|. 40 // |attribute_value|.
41 void UpdateDOMAttribute(const std::string& attribute_name, 41 void UpdateDOMAttribute(const std::string& attribute_name,
42 const std::string& attribute_value); 42 const std::string& attribute_value);
43 43
44 // Get the name attribute value.
45 std::string name_attribute() const { return name_; }
46 // Set the name attribute value.
47 void SetNameAttribute(const std::string& name);
44 // Get the src attribute value of the BrowserPlugin instance. 48 // Get the src attribute value of the BrowserPlugin instance.
45 std::string src_attribute() const { return src_; } 49 std::string src_attribute() const { return src_; }
46 // Set the src attribute value of the BrowserPlugin instance. 50 // Set the src attribute value of the BrowserPlugin instance.
47 bool SetSrcAttribute(const std::string& src, std::string* error_message); 51 bool SetSrcAttribute(const std::string& src, std::string* error_message);
48 // Get the autosize attribute value. 52 // Get the autosize attribute value.
49 bool auto_size_attribute() const { return auto_size_; } 53 bool auto_size_attribute() const { return auto_size_; }
50 // Sets the autosize attribute value. 54 // Sets the autosize attribute value.
51 void SetAutoSizeAttribute(bool auto_size); 55 void SetAutoSizeAttribute(bool auto_size);
52 // Get the maxheight attribute value. 56 // Get the maxheight attribute value.
53 int max_height_attribute() const { return max_height_; } 57 int max_height_attribute() const { return max_height_; }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 // Inform the BrowserPlugin that the guest has started loading a new page. 104 // Inform the BrowserPlugin that the guest has started loading a new page.
101 void LoadStart(const GURL& url, bool is_top_level); 105 void LoadStart(const GURL& url, bool is_top_level);
102 // Inform the BrowserPlugin that the guest has finished loading a new page. 106 // Inform the BrowserPlugin that the guest has finished loading a new page.
103 void LoadStop(); 107 void LoadStop();
104 // Inform the BrowserPlugin that the guest has aborted loading a new page. 108 // Inform the BrowserPlugin that the guest has aborted loading a new page.
105 void LoadAbort(const GURL& url, bool is_top_level, const std::string& type); 109 void LoadAbort(const GURL& url, bool is_top_level, const std::string& type);
106 // Inform the BrowserPlugin that the guest has redirected a navigation. 110 // Inform the BrowserPlugin that the guest has redirected a navigation.
107 void LoadRedirect(const GURL& old_url, 111 void LoadRedirect(const GURL& old_url,
108 const GURL& new_url, 112 const GURL& new_url,
109 bool is_top_level); 113 bool is_top_level);
114 // Tells the BrowserPlugin that the guest's name has been updated.
115 void UpdatedName(const std::string& name);
110 // Tells the BrowserPlugin to advance the focus to the next (or previous) 116 // Tells the BrowserPlugin to advance the focus to the next (or previous)
111 // element. 117 // element.
112 void AdvanceFocus(bool reverse); 118 void AdvanceFocus(bool reverse);
113 // Inform the BrowserPlugin of the focus state of the embedder RenderView. 119 // Inform the BrowserPlugin of the focus state of the embedder RenderView.
114 void SetEmbedderFocus(bool focused); 120 void SetEmbedderFocus(bool focused);
115 // Informs the guest of an updated focus state. 121 // Informs the guest of an updated focus state.
116 void UpdateGuestFocusState(); 122 void UpdateGuestFocusState();
117 // Indicates whether the guest should be focused. 123 // Indicates whether the guest should be focused.
118 bool ShouldGuestBeFocused() const; 124 bool ShouldGuestBeFocused() const;
119 125
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 int process_id_; 315 int process_id_;
310 std::string storage_partition_id_; 316 std::string storage_partition_id_;
311 bool persist_storage_; 317 bool persist_storage_;
312 bool valid_partition_id_; 318 bool valid_partition_id_;
313 int content_window_routing_id_; 319 int content_window_routing_id_;
314 bool plugin_focused_; 320 bool plugin_focused_;
315 bool embedder_focused_; 321 bool embedder_focused_;
316 // Tracks the visibility of the browser plugin regardless of the whole 322 // Tracks the visibility of the browser plugin regardless of the whole
317 // embedder RenderView's visibility. 323 // embedder RenderView's visibility.
318 bool visible_; 324 bool visible_;
325 std::string name_;
319 326
320 WebCursor cursor_; 327 WebCursor cursor_;
321 328
322 gfx::Size last_view_size_; 329 gfx::Size last_view_size_;
323 bool size_changed_in_flight_; 330 bool size_changed_in_flight_;
324 331
325 // BrowserPlugin outlives RenderViewImpl in Chrome Apps and so we need to 332 // BrowserPlugin outlives RenderViewImpl in Chrome Apps and so we need to
326 // store the BrowserPlugin's BrowserPluginManager in a member variable to 333 // store the BrowserPlugin's BrowserPluginManager in a member variable to
327 // avoid accessing the RenderViewImpl. 334 // avoid accessing the RenderViewImpl.
328 scoped_refptr<BrowserPluginManager> browser_plugin_manager_; 335 scoped_refptr<BrowserPluginManager> browser_plugin_manager_;
329 336
330 // Important: Do not add more history state here. 337 // Important: Do not add more history state here.
331 // We strongly discourage storing additional history state (such as page IDs) 338 // We strongly discourage storing additional history state (such as page IDs)
332 // in the embedder process, at the risk of having incorrect information that 339 // in the embedder process, at the risk of having incorrect information that
333 // can lead to broken back/forward logic in apps. 340 // can lead to broken back/forward logic in apps.
334 // It's also important that this state does not get modified by any logic in 341 // It's also important that this state does not get modified by any logic in
335 // the embedder process. It should only be updated in response to navigation 342 // the embedder process. It should only be updated in response to navigation
336 // events in the guest. No assumptions should be made about how the index 343 // events in the guest. No assumptions should be made about how the index
337 // will change after a navigation (e.g., for back, forward, or go), because 344 // will change after a navigation (e.g., for back, forward, or go), because
338 // the changes are not always obvious. For example, there is a maximum 345 // the changes are not always obvious. For example, there is a maximum
339 // number of entries and earlier ones will automatically be pruned. 346 // number of entries and earlier ones will automatically be pruned.
340 int current_nav_entry_index_; 347 int current_nav_entry_index_;
341 int nav_entry_count_; 348 int nav_entry_count_;
342 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); 349 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin);
343 }; 350 };
344 351
345 } // namespace content 352 } // namespace content
346 353
347 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ 354 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698