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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.h

Issue 1062273002: Snap RWHVA and resize the legacy window on Windows whenever the ancestor window's bounds change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add DCHECK in WindowAncestorObserver::OnWindowBoundsChanged Created 5 years, 8 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 | « no previous file | content/browser/renderer_host/render_widget_host_view_aura.cc » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, 394 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest,
395 OverscrollResetsOnBlur); 395 OverscrollResetsOnBlur);
396 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, 396 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest,
397 FinishCompositionByMouse); 397 FinishCompositionByMouse);
398 FRIEND_TEST_ALL_PREFIXES(WebContentsViewAuraTest, 398 FRIEND_TEST_ALL_PREFIXES(WebContentsViewAuraTest,
399 WebContentsViewReparent); 399 WebContentsViewReparent);
400 400
401 class WindowObserver; 401 class WindowObserver;
402 friend class WindowObserver; 402 friend class WindowObserver;
403 403
404 class WindowAncestorObserver;
405 friend class WindowAncestorObserver;
406
404 void UpdateCursorIfOverSelf(); 407 void UpdateCursorIfOverSelf();
405 408
406 // Tracks whether SnapToPhysicalPixelBoundary() has been called. 409 // Tracks whether SnapToPhysicalPixelBoundary() has been called.
407 bool has_snapped_to_boundary() { return has_snapped_to_boundary_; } 410 bool has_snapped_to_boundary() { return has_snapped_to_boundary_; }
408 void ResetHasSnappedToBoundary() { has_snapped_to_boundary_ = false; } 411 void ResetHasSnappedToBoundary() { has_snapped_to_boundary_ = false; }
409 412
410 // Set the bounds of the window and handle size changes. Assumes the caller 413 // Set the bounds of the window and handle size changes. Assumes the caller
411 // has already adjusted the origin of |rect| to conform to whatever coordinate 414 // has already adjusted the origin of |rect| to conform to whatever coordinate
412 // space is required by the aura::Window. 415 // space is required by the aura::Window.
413 void InternalSetBounds(const gfx::Rect& rect); 416 void InternalSetBounds(const gfx::Rect& rect);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 // Helper function to set keyboard focus to the main window. 496 // Helper function to set keyboard focus to the main window.
494 void SetKeyboardFocus(); 497 void SetKeyboardFocus();
495 498
496 RenderFrameHostImpl* GetFocusedFrame(); 499 RenderFrameHostImpl* GetFocusedFrame();
497 500
498 // Returns true if the |event| passed in can be forwarded to the renderer. 501 // Returns true if the |event| passed in can be forwarded to the renderer.
499 bool CanRendererHandleEvent(const ui::MouseEvent* event, 502 bool CanRendererHandleEvent(const ui::MouseEvent* event,
500 bool mouse_locked, 503 bool mouse_locked,
501 bool selection_popup); 504 bool selection_popup);
502 505
506 // Called when the parent window bounds change.
507 void HandleParentBoundsChanged();
508
509 // Called when the parent window hierarchy for our window changes.
510 void ParentHierarchyChanged();
511
503 // The model object. 512 // The model object.
504 RenderWidgetHostImpl* host_; 513 RenderWidgetHostImpl* host_;
505 514
506 aura::Window* window_; 515 aura::Window* window_;
507 516
508 scoped_ptr<DelegatedFrameHost> delegated_frame_host_; 517 scoped_ptr<DelegatedFrameHost> delegated_frame_host_;
509 518
510 scoped_ptr<WindowObserver> window_observer_; 519 scoped_ptr<WindowObserver> window_observer_;
511 520
521 // Tracks the ancestors of the RWHVA window for window location changes.
522 scoped_ptr<WindowAncestorObserver> ancestor_window_observer_;
523
512 // Are we in the process of closing? Tracked so fullscreen views can avoid 524 // Are we in the process of closing? Tracked so fullscreen views can avoid
513 // sending a second shutdown request to the host when they lose the focus 525 // sending a second shutdown request to the host when they lose the focus
514 // after requesting shutdown for another reason (e.g. Escape key). 526 // after requesting shutdown for another reason (e.g. Escape key).
515 bool in_shutdown_; 527 bool in_shutdown_;
516 528
517 // True if in the process of handling a window bounds changed notification. 529 // True if in the process of handling a window bounds changed notification.
518 bool in_bounds_changed_; 530 bool in_bounds_changed_;
519 531
520 // Is this a fullscreen view? 532 // Is this a fullscreen view?
521 bool is_fullscreen_; 533 bool is_fullscreen_;
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 // compositing surface and showing the disambiguation popup. 670 // compositing surface and showing the disambiguation popup.
659 gfx::Vector2dF disambiguation_scroll_offset_; 671 gfx::Vector2dF disambiguation_scroll_offset_;
660 672
661 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; 673 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_;
662 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); 674 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura);
663 }; 675 };
664 676
665 } // namespace content 677 } // namespace content
666 678
667 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ 679 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698