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

Side by Side Diff: chrome/renderer/render_view.cc

Issue 400028: Make extension popups shrink when their contents shrink. (Closed)
Patch Set: Created 11 years, 1 month 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
« no previous file with comments | « chrome/common/extensions/docs/examples/extensions/news/feed.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #if defined(ENABLE_PEPPER) 5 #if defined(ENABLE_PEPPER)
6 #define PEPPER_APIS_ENABLED 6 #define PEPPER_APIS_ENABLED
7 #endif 7 #endif
8 8
9 #include "chrome/renderer/render_view.h" 9 #include "chrome/renderer/render_view.h"
10 10
(...skipping 2528 matching lines...) Expand 10 before | Expand all | Expand 10 after
2539 2539
2540 void RenderView::didChangeContentsSize(WebFrame* frame, const WebSize& size) { 2540 void RenderView::didChangeContentsSize(WebFrame* frame, const WebSize& size) {
2541 // We don't always want to send the change messages over IPC, only if we've 2541 // We don't always want to send the change messages over IPC, only if we've
2542 // be put in that mode by getting a |ViewMsg_EnablePreferredSizeChangedMode| 2542 // be put in that mode by getting a |ViewMsg_EnablePreferredSizeChangedMode|
2543 // message. 2543 // message.
2544 if (send_preferred_size_changes_) { 2544 if (send_preferred_size_changes_) {
2545 // WebCore likes to tell us things have changed even when they haven't, so 2545 // WebCore likes to tell us things have changed even when they haven't, so
2546 // cache the width and height and only send the IPC message when we're sure 2546 // cache the width and height and only send the IPC message when we're sure
2547 // they're different. 2547 // they're different.
2548 int width = webview()->mainFrame()->contentsPreferredWidth(); 2548 int width = webview()->mainFrame()->contentsPreferredWidth();
2549 int height = webview()->mainFrame()->documentElementScrollHeight();
2550
2549 if (width != preferred_size_.width() || 2551 if (width != preferred_size_.width() ||
2550 size.height != preferred_size_.height()) { 2552 height != preferred_size_.height()) {
2551 preferred_size_.set_width(width); 2553 preferred_size_.set_width(width);
2554 preferred_size_.set_height(height);
2552 2555
2553 // TODO(erikkay) the contents size is not really the same as the
2554 // preferred size. It's just the current size. This means that for
2555 // height, it will only ever grow, it will never shrink.
2556 preferred_size_.set_height(size.height);
2557 Send(new ViewHostMsg_DidContentsPreferredSizeChange(routing_id_, 2556 Send(new ViewHostMsg_DidContentsPreferredSizeChange(routing_id_,
2558 preferred_size_)); 2557 preferred_size_));
2559 } 2558 }
2560 } 2559 }
2561 } 2560 }
2562 2561
2563 void RenderView::didChangeScrollOffset(WebFrame* frame) { 2562 void RenderView::didChangeScrollOffset(WebFrame* frame) {
2564 StartNavStateSyncTimerIfNecessary(); 2563 StartNavStateSyncTimerIfNecessary();
2565 } 2564 }
2566 2565
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after
3839 new PluginMsg_SignalModalDialogEvent(host_window_)); 3838 new PluginMsg_SignalModalDialogEvent(host_window_));
3840 3839
3841 message->EnableMessagePumping(); // Runs a nested message loop. 3840 message->EnableMessagePumping(); // Runs a nested message loop.
3842 bool rv = Send(message); 3841 bool rv = Send(message);
3843 3842
3844 PluginChannelHost::Broadcast( 3843 PluginChannelHost::Broadcast(
3845 new PluginMsg_ResetModalDialogEvent(host_window_)); 3844 new PluginMsg_ResetModalDialogEvent(host_window_));
3846 3845
3847 return rv; 3846 return rv;
3848 } 3847 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/examples/extensions/news/feed.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698