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

Unified Diff: chrome/browser/guest_view/web_view/web_view_guest.h

Issue 427883002: <webview>: Move autosize from content to chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_frame_url
Patch Set: Works Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/guest_view/web_view/web_view_guest.h
diff --git a/chrome/browser/guest_view/web_view/web_view_guest.h b/chrome/browser/guest_view/web_view/web_view_guest.h
index 0150bbf46b81b0ed61a47686b70e90655f47080e..b194cbfe57eaf30e8f2cd24a18afd74211dffeca 100644
--- a/chrome/browser/guest_view/web_view/web_view_guest.h
+++ b/chrome/browser/guest_view/web_view/web_view_guest.h
@@ -66,6 +66,10 @@ class WebViewGuest : public GuestView<WebViewGuest>,
static const char Type[];
+ void SetAutoSize(bool enabled,
+ const gfx::Size& min_size,
+ const gfx::Size& max_size);
+
// Request navigating the guest to the provided |src| URL.
void NavigateGuest(const std::string& src);
@@ -156,8 +160,10 @@ class WebViewGuest : public GuestView<WebViewGuest>,
// BrowserPluginGuestDelegate implementation.
virtual content::WebContents* CreateNewGuestWindow(
const content::WebContents::CreateParams& create_params) OVERRIDE;
- virtual void SizeChanged(const gfx::Size& old_size, const gfx::Size& new_size)
- OVERRIDE;
+ virtual void GuestSizeChanged(const gfx::Size& old_size,
+ const gfx::Size& new_size) OVERRIDE;
+ virtual void ElementSizeChanged(const gfx::Size& old_size,
+ const gfx::Size& new_size) OVERRIDE;
virtual void RequestPointerLockPermission(
bool user_gesture,
bool last_unlocked_by_target,
@@ -334,6 +340,9 @@ class WebViewGuest : public GuestView<WebViewGuest>,
bool HandleKeyboardShortcuts(const content::NativeWebKeyboardEvent& event);
+ void DispatchSizeChangedEvent(const gfx::Size& old_size,
+ const gfx::Size& new_size);
+
ObserverList<extensions::TabHelper::ScriptExecutionObserver>
script_observers_;
scoped_ptr<extensions::ScriptExecutor> script_executor_;
@@ -393,6 +402,13 @@ class WebViewGuest : public GuestView<WebViewGuest>,
typedef std::map<WebViewGuest*, NewWindowInfo> PendingWindowMap;
PendingWindowMap pending_new_windows_;
+ gfx::Size element_size_;
lazyboy 2014/07/31 04:24:22 add description of these two gfx::Size members.
Fady Samuel 2014/08/01 18:12:52 Done.
+ gfx::Size guest_size_;
+ bool auto_size_enabled_;
+ bool auto_size_disabling_;
lazyboy 2014/07/31 04:24:22 Add description
Fady Samuel 2014/08/01 18:12:52 Looks like this is unnecessary. Removed.
+ gfx::Size max_auto_size_;
+ gfx::Size min_auto_size_;
+
DISALLOW_COPY_AND_ASSIGN(WebViewGuest);
};

Powered by Google App Engine
This is Rietveld 408576698