14e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// Copyright (c) 2013 The Chromium Authors. All rights reserved. 24e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 34e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// found in the LICENSE file. 44e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 54e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#ifndef UI_V2_PUBLIC_LAYOUT_H_ 64e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#define UI_V2_PUBLIC_LAYOUT_H_ 74e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 84e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#include "ui/v2/public/v2_export.h" 94e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#include "ui/v2/public/view_observer.h" 104e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 114e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)namespace v2 { 124e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 134e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)class V2_EXPORT Layout { 144e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) public: 154e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) virtual ~Layout(); 164e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 174e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) // Called by the View to commit the bounds. It is up to the Layout to 184e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) // figure out what bounds to actually set, via SetBoundsDirect below. 194e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) virtual void SetChildBounds(View* child, 204e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) const gfx::Rect& requested_bounds); 214e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 224e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) protected: 234e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) // Sets the specified |bounds| on |child| without consulting layout. 244e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) void SetChildBoundsDirect(View* child, const gfx::Rect& bounds); 254e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)}; 264e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 274e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)} // namespace v2 284e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 294e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#endif // UI_V2_PUBLIC_LAYOUT_H_ 30