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

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

Issue 556058: Quick hack to make popup shrinkage work again (Closed)
Patch Set: Only run timer on extension views Created 10 years, 10 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 unified diff | Download patch
« no previous file with comments | « chrome/renderer/render_view.h ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 2649 matching lines...) Expand 10 before | Expand all | Expand 10 after
2660 2660
2661 void RenderView::didDestroyScriptContext(WebFrame* frame) { 2661 void RenderView::didDestroyScriptContext(WebFrame* frame) {
2662 EventBindings::HandleContextDestroyed(frame); 2662 EventBindings::HandleContextDestroyed(frame);
2663 } 2663 }
2664 2664
2665 void RenderView::didCreateIsolatedScriptContext(WebFrame* frame) { 2665 void RenderView::didCreateIsolatedScriptContext(WebFrame* frame) {
2666 EventBindings::HandleContextCreated(frame, true); 2666 EventBindings::HandleContextCreated(frame, true);
2667 } 2667 }
2668 2668
2669 void RenderView::didChangeContentsSize(WebFrame* frame, const WebSize& size) { 2669 void RenderView::didChangeContentsSize(WebFrame* frame, const WebSize& size) {
2670 CheckPreferredSize();
2671 }
2672
2673 void RenderView::CheckPreferredSize() {
2670 // We don't always want to send the change messages over IPC, only if we've 2674 // We don't always want to send the change messages over IPC, only if we've
2671 // be put in that mode by getting a |ViewMsg_EnablePreferredSizeChangedMode| 2675 // be put in that mode by getting a |ViewMsg_EnablePreferredSizeChangedMode|
2672 // message. 2676 // message.
2673 if (send_preferred_size_changes_) { 2677 if (send_preferred_size_changes_) {
2674 // WebCore likes to tell us things have changed even when they haven't, so 2678 // WebCore likes to tell us things have changed even when they haven't, so
2675 // cache the width and height and only send the IPC message when we're sure 2679 // cache the width and height and only send the IPC message when we're sure
2676 // they're different. 2680 // they're different.
2677 int width = webview()->mainFrame()->contentsPreferredWidth(); 2681 int width = webview()->mainFrame()->contentsPreferredWidth();
2678 int height = webview()->mainFrame()->documentElementScrollHeight(); 2682 int height = webview()->mainFrame()->documentElementScrollHeight();
2679 2683
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
3352 return; 3356 return;
3353 WebFrame* main_frame = webview()->mainFrame(); 3357 WebFrame* main_frame = webview()->mainFrame();
3354 if (!main_frame) 3358 if (!main_frame)
3355 return; 3359 return;
3356 3360
3357 main_frame->enableViewSourceMode(true); 3361 main_frame->enableViewSourceMode(true);
3358 } 3362 }
3359 3363
3360 void RenderView::OnEnablePreferredSizeChangedMode() { 3364 void RenderView::OnEnablePreferredSizeChangedMode() {
3361 send_preferred_size_changes_ = true; 3365 send_preferred_size_changes_ = true;
3366 if (CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
3367 switches::kProcessType) == switches::kExtensionProcess) {
3368 preferred_size_change_timer_.Start(TimeDelta::FromMilliseconds(10), this,
3369 &RenderView::CheckPreferredSize);
3370 }
3362 } 3371 }
3363 3372
3364 void RenderView::OnSetRendererPrefs(const RendererPreferences& renderer_prefs) { 3373 void RenderView::OnSetRendererPrefs(const RendererPreferences& renderer_prefs) {
3365 renderer_preferences_ = renderer_prefs; 3374 renderer_preferences_ = renderer_prefs;
3366 UpdateFontRenderingFromRendererPrefs(); 3375 UpdateFontRenderingFromRendererPrefs();
3367 #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) 3376 #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS)
3368 WebColorName name = WebKit::WebColorWebkitFocusRingColor; 3377 WebColorName name = WebKit::WebColorWebkitFocusRingColor;
3369 WebKit::setNamedColors(&name, &renderer_prefs.focus_ring_color, 1); 3378 WebKit::setNamedColors(&name, &renderer_prefs.focus_ring_color, 1);
3370 3379
3371 if (webview()) { 3380 if (webview()) {
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
4099 new PluginMsg_SignalModalDialogEvent(host_window_)); 4108 new PluginMsg_SignalModalDialogEvent(host_window_));
4100 4109
4101 message->EnableMessagePumping(); // Runs a nested message loop. 4110 message->EnableMessagePumping(); // Runs a nested message loop.
4102 bool rv = Send(message); 4111 bool rv = Send(message);
4103 4112
4104 PluginChannelHost::Broadcast( 4113 PluginChannelHost::Broadcast(
4105 new PluginMsg_ResetModalDialogEvent(host_window_)); 4114 new PluginMsg_ResetModalDialogEvent(host_window_));
4106 4115
4107 return rv; 4116 return rv;
4108 } 4117 }
OLDNEW
« no previous file with comments | « chrome/renderer/render_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698