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

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

Issue 16488: Add a new resizer corner overlay. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 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 | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/render_widget.h ('k') | chrome/test/test_browser_window.h » ('j') | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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_widget.h" 5 #include "chrome/renderer/render_widget.h"
6 6
7 #include "base/gfx/point.h" 7 #include "base/gfx/point.h"
8 #include "base/gfx/size.h" 8 #include "base/gfx/size.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 222
223 // If there is a Send call on the stack, then it could be dangerous to close 223 // If there is a Send call on the stack, then it could be dangerous to close
224 // now. Instead, we wait until we get out of Send. 224 // now. Instead, we wait until we get out of Send.
225 if (render_thread_->InSend()) { 225 if (render_thread_->InSend()) {
226 DeferredCloses::Push(this); 226 DeferredCloses::Push(this);
227 } else { 227 } else {
228 Close(); 228 Close();
229 } 229 }
230 } 230 }
231 231
232 void RenderWidget::OnResize(const gfx::Size& new_size) { 232 void RenderWidget::OnResize(const gfx::Size& new_size,
233 const gfx::Rect& resizer_rect) {
233 // During shutdown we can just ignore this message. 234 // During shutdown we can just ignore this message.
234 if (!webwidget_) 235 if (!webwidget_)
235 return; 236 return;
236 237
238 // Remember the rect where the resize corner will be drawn.
239 resizer_rect_ = resizer_rect;
240
237 // TODO(darin): We should not need to reset this here. 241 // TODO(darin): We should not need to reset this here.
238 is_hidden_ = false; 242 is_hidden_ = false;
239 needs_repainting_on_restore_ = false; 243 needs_repainting_on_restore_ = false;
240 244
241 // We shouldn't be asked to resize to our current size. 245 // We shouldn't be asked to resize to our current size.
242 DCHECK(size_ != new_size); 246 DCHECK(size_ != new_size);
243 size_ = new_size; 247 size_ = new_size;
244 248
245 // We should not be sent a Resize message if we have not ACK'd the previous 249 // We should not be sent a Resize message if we have not ACK'd the previous
246 DCHECK(!next_paint_is_resize_ack()); 250 DCHECK(!next_paint_is_resize_ack());
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 initial_pos_ = pos; 691 initial_pos_ = pos;
688 } 692 }
689 } 693 }
690 694
691 void RenderWidget::GetRootWindowRect(WebWidget* webwidget, gfx::Rect* rect) { 695 void RenderWidget::GetRootWindowRect(WebWidget* webwidget, gfx::Rect* rect) {
692 Send(new ViewHostMsg_GetRootWindowRect(routing_id_, host_window_, rect)); 696 Send(new ViewHostMsg_GetRootWindowRect(routing_id_, host_window_, rect));
693 } 697 }
694 698
695 void RenderWidget::GetRootWindowResizerRect(WebWidget* webwidget, 699 void RenderWidget::GetRootWindowResizerRect(WebWidget* webwidget,
696 gfx::Rect* rect) { 700 gfx::Rect* rect) {
697 Send(new ViewHostMsg_GetRootWindowResizerRect(routing_id_, host_window_, 701 *rect = resizer_rect_;
698 rect));
699 } 702 }
700 703
701 void RenderWidget::OnImeSetInputMode(bool is_active) { 704 void RenderWidget::OnImeSetInputMode(bool is_active) {
702 // To prevent this renderer process from sending unnecessary IPC messages to 705 // To prevent this renderer process from sending unnecessary IPC messages to
703 // a browser process, we permit the renderer process to send IPC messages 706 // a browser process, we permit the renderer process to send IPC messages
704 // only during the IME attached to the browser process is active. 707 // only during the IME attached to the browser process is active.
705 ime_is_active_ = is_active; 708 ime_is_active_ = is_active;
706 } 709 }
707 710
708 void RenderWidget::OnImeSetComposition(int string_type, 711 void RenderWidget::OnImeSetComposition(int string_type,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 for (; i < plugin_window_moves_.size(); ++i) { 829 for (; i < plugin_window_moves_.size(); ++i) {
827 if (plugin_window_moves_[i].window == move.window) { 830 if (plugin_window_moves_[i].window == move.window) {
828 plugin_window_moves_[i] = move; 831 plugin_window_moves_[i] = move;
829 break; 832 break;
830 } 833 }
831 } 834 }
832 835
833 if (i == plugin_window_moves_.size()) 836 if (i == plugin_window_moves_.size())
834 plugin_window_moves_.push_back(move); 837 plugin_window_moves_.push_back(move);
835 } 838 }
OLDNEW
« no previous file with comments | « chrome/renderer/render_widget.h ('k') | chrome/test/test_browser_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698