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

Unified Diff: trunk/src/chrome/browser/guest_view/web_view/web_view_guest.cc

Issue 446823002: Revert 287732 "<webview>: Move autosize from content to chrome." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 4 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: trunk/src/chrome/browser/guest_view/web_view/web_view_guest.cc
===================================================================
--- trunk/src/chrome/browser/guest_view/web_view/web_view_guest.cc (revision 287745)
+++ trunk/src/chrome/browser/guest_view/web_view/web_view_guest.cc (working copy)
@@ -297,8 +297,6 @@
}
void WebViewGuest::DidAttachToEmbedder() {
- SetUpAutoSize();
-
std::string name;
if (extra_params()->GetString(webview::kName, &name)) {
// If the guest window's name is empty, then the WebView tag's name is
@@ -424,27 +422,6 @@
RemoveWebViewStateFromIOThread(web_contents());
}
-void WebViewGuest::GuestReady() {
- // The guest RenderView should always live in an isolated guest process.
- CHECK(guest_web_contents()->GetRenderProcessHost()->IsIsolatedGuest());
- Send(new ChromeViewMsg_SetName(guest_web_contents()->GetRoutingID(), name_));
-}
-
-void WebViewGuest::GuestSizeChangedDueToAutoSize(const gfx::Size& old_size,
- const gfx::Size& new_size) {
- scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue());
- args->SetInteger(webview::kOldHeight, old_size.height());
- args->SetInteger(webview::kOldWidth, old_size.width());
- args->SetInteger(webview::kNewHeight, new_size.height());
- args->SetInteger(webview::kNewWidth, new_size.width());
- DispatchEventToEmbedder(
- new GuestViewBase::Event(webview::kEventSizeChanged, args.Pass()));
-}
-
-bool WebViewGuest::IsAutoSizeSupported() const {
- return true;
-}
-
bool WebViewGuest::IsDragAndDropEnabled() const {
return true;
}
@@ -821,6 +798,12 @@
guest_web_contents()->GetController().Reload(false);
}
+void WebViewGuest::RenderViewReady() {
+ // The guest RenderView should always live in an isolated guest process.
+ CHECK(guest_web_contents()->GetRenderProcessHost()->IsIsolatedGuest());
+ Send(new ChromeViewMsg_SetName(guest_web_contents()->GetRoutingID(), name_));
+}
+
void WebViewGuest::ReportFrameNameChange(const std::string& name) {
name_ = name;
scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue());
@@ -897,6 +880,17 @@
create_params);
}
+void WebViewGuest::SizeChanged(const gfx::Size& old_size,
+ const gfx::Size& new_size) {
+ scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue());
+ args->SetInteger(webview::kOldHeight, old_size.height());
+ args->SetInteger(webview::kOldWidth, old_size.width());
+ args->SetInteger(webview::kNewHeight, new_size.height());
+ args->SetInteger(webview::kNewWidth, new_size.width());
+ DispatchEventToEmbedder(
+ new GuestViewBase::Event(webview::kEventSizeChanged, args.Pass()));
+}
+
void WebViewGuest::RequestMediaAccessPermission(
content::WebContents* source,
const content::MediaStreamRequest& request,
@@ -1058,28 +1052,6 @@
return false;
}
-void WebViewGuest::SetUpAutoSize() {
- // Read the autosize parameters passed in from the embedder.
- bool auto_size_enabled;
- extra_params()->GetBoolean(webview::kAttributeAutoSize, &auto_size_enabled);
-
- int max_height = 0;
- int max_width = 0;
- extra_params()->GetInteger(webview::kAttributeMaxHeight, &max_height);
- extra_params()->GetInteger(webview::kAttributeMaxWidth, &max_width);
-
- int min_height = 0;
- int min_width = 0;
- extra_params()->GetInteger(webview::kAttributeMinHeight, &min_height);
- extra_params()->GetInteger(webview::kAttributeMinWidth, &min_width);
-
- // Call SetAutoSize to apply all the appropriate validation and clipping of
- // values.
- SetAutoSize(auto_size_enabled,
- gfx::Size(min_width, min_height),
- gfx::Size(max_width, max_height));
-}
-
void WebViewGuest::ShowContextMenu(int request_id,
const MenuItemVector* items) {
if (!pending_menu_.get())

Powered by Google App Engine
This is Rietveld 408576698