| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "chrome/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1976 Send(new ViewHostMsg_OpenURL( | 1976 Send(new ViewHostMsg_OpenURL( |
| 1977 routing_id_, url, referrer, NavigationPolicyToDisposition(policy))); | 1977 routing_id_, url, referrer, NavigationPolicyToDisposition(policy))); |
| 1978 } | 1978 } |
| 1979 | 1979 |
| 1980 void RenderView::DidContentsSizeChange(WebWidget* webwidget, | 1980 void RenderView::DidContentsSizeChange(WebWidget* webwidget, |
| 1981 int new_width, | 1981 int new_width, |
| 1982 int new_height) { | 1982 int new_height) { |
| 1983 // We don't always want to send the change messages over IPC, only if we've | 1983 // We don't always want to send the change messages over IPC, only if we've |
| 1984 // be put in that mode by getting a |ViewMsg_EnableIntrinsicWidthChangedMode| | 1984 // be put in that mode by getting a |ViewMsg_EnableIntrinsicWidthChangedMode| |
| 1985 // message. | 1985 // message. |
| 1986 // TODO(rafaelw): Figure out where the best place to set this for extensions | 1986 if (send_preferred_width_changes_) { |
| 1987 // is. It isn't clean to test for ExtensionView by examining the | |
| 1988 // enabled_bindings. This needs to be generalized as it becomes clear what | |
| 1989 // extension toolbars need. | |
| 1990 if (BindingsPolicy::is_extension_enabled(enabled_bindings_) || | |
| 1991 send_preferred_width_changes_) { | |
| 1992 // WebCore likes to tell us things have changed even when they haven't, so | 1987 // WebCore likes to tell us things have changed even when they haven't, so |
| 1993 // cache the width and only send the IPC message when we're sure the | 1988 // cache the width and only send the IPC message when we're sure the |
| 1994 // width is different. | 1989 // width is different. |
| 1995 int width = webview()->GetMainFrame()->contentsPreferredWidth(); | 1990 int width = webview()->GetMainFrame()->contentsPreferredWidth(); |
| 1996 if (width != preferred_width_) { | 1991 if (width != preferred_width_) { |
| 1997 Send(new ViewHostMsg_DidContentsPreferredWidthChange(routing_id_, width)); | 1992 Send(new ViewHostMsg_DidContentsPreferredWidthChange(routing_id_, width)); |
| 1998 preferred_width_ = width; | 1993 preferred_width_ = width; |
| 1999 } | 1994 } |
| 2000 } | 1995 } |
| 2001 } | 1996 } |
| (...skipping 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3420 Send(new ViewHostMsg_PasswordFormsSeen(routing_id_, password_forms)); | 3415 Send(new ViewHostMsg_PasswordFormsSeen(routing_id_, password_forms)); |
| 3421 } | 3416 } |
| 3422 | 3417 |
| 3423 void RenderView::Print(WebFrame* frame, bool script_initiated) { | 3418 void RenderView::Print(WebFrame* frame, bool script_initiated) { |
| 3424 DCHECK(frame); | 3419 DCHECK(frame); |
| 3425 if (print_helper_.get() == NULL) { | 3420 if (print_helper_.get() == NULL) { |
| 3426 print_helper_.reset(new PrintWebViewHelper(this)); | 3421 print_helper_.reset(new PrintWebViewHelper(this)); |
| 3427 } | 3422 } |
| 3428 print_helper_->Print(frame, script_initiated); | 3423 print_helper_->Print(frame, script_initiated); |
| 3429 } | 3424 } |
| OLD | NEW |