chrome/browser/chromeos/input_method/candidate_window.cc
// Wraps the given view with some padding, and returns it.
Wraps the given view with some padding, and returns it.
Wraps the given view with some padding and returns it .
views::View* WrapWithPadding(views::View* view, const gfx::Insets& insets) {
  views::View* wrapper = new views::View;
  views::GridLayout* layout = new views::GridLayout(wrapper);
  wrapper->SetLayoutManager(layout);  
  layout->SetInsets(insets);
  views::ColumnSet* column_set = layout->AddColumnSet(0);
  column_set->AddColumn(
      views::GridLayout::FILL, views::GridLayout::FILL,
      1, views::GridLayout::USE_PREF, 0, 0);
  layout->StartRow(0, 0);
  layout->AddView(view);  
  return wrapper;
}
views :: View * WrapWithPadding ( views :: View * view , const gfx :: Insets & insets ) { views :: View * wrapper = new views :: View ; views :: GridLayout * layout = new views :: GridLayout ( wrapper ) ; wrapper -> SetLayoutManager ( layout ) ; layout -> SetInsets ( insets ) ; views :: ColumnSet * column_set = layout -> AddColumnSet ( 0 ) ; column_set -> AddColumn ( views :: GridLayout :: FILL , views :: GridLayout :: FILL , 1 , views :: GridLayout :: USE_PREF , 0 , 0 ) ; layout -> StartRow ( 0 , 0 ) ; layout -> AddView ( view ) ; return wrapper ; }
Wraps the given view with some padding, and returns it.
Wraps the given view with some padding and returns it .
// Use GridLayout to give some insets inside. // |wrapper| owns |layout|. // Add the view contents. // |view| is owned by |wraper|, not |layout|.