| OLD | NEW |
| 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 #include "chrome/browser/ui/views/sad_tab_view.h" | 5 #include "chrome/browser/ui/views/sad_tab_view.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 message_->SizeToFit(static_cast<int>(width() * kMessageSize)); | 130 message_->SizeToFit(static_cast<int>(width() * kMessageSize)); |
| 131 View::Layout(); | 131 View::Layout(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void SadTabView::ViewHierarchyChanged(bool is_add, | 134 void SadTabView::ViewHierarchyChanged(bool is_add, |
| 135 views::View* parent, | 135 views::View* parent, |
| 136 views::View* child) { | 136 views::View* child) { |
| 137 if (child != this || !is_add) | 137 if (child != this || !is_add) |
| 138 return; | 138 return; |
| 139 | 139 |
| 140 views::GridLayout* layout = views::GridLayout::CreatePanel(this); | 140 views::GridLayout* layout = new views::GridLayout(this); |
| 141 SetLayoutManager(layout); | 141 SetLayoutManager(layout); |
| 142 | 142 |
| 143 const int column_set_id = 0; | 143 const int column_set_id = 0; |
| 144 views::ColumnSet* columns = layout->AddColumnSet(column_set_id); | 144 views::ColumnSet* columns = layout->AddColumnSet(column_set_id); |
| 145 columns->AddPaddingColumn(1, kPadding); | 145 columns->AddPaddingColumn(1, kPadding); |
| 146 columns->AddColumn(views::GridLayout::CENTER, views::GridLayout::CENTER, | 146 columns->AddColumn(views::GridLayout::CENTER, views::GridLayout::CENTER, |
| 147 0, views::GridLayout::USE_PREF, 0, 0); | 147 0, views::GridLayout::USE_PREF, 0, 0); |
| 148 columns->AddPaddingColumn(1, kPadding); | 148 columns->AddPaddingColumn(1, kPadding); |
| 149 | 149 |
| 150 views::ImageView* image = new views::ImageView(); | 150 views::ImageView* image = new views::ImageView(); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 } | 296 } |
| 297 | 297 |
| 298 namespace chrome { | 298 namespace chrome { |
| 299 | 299 |
| 300 SadTab* SadTab::Create(content::WebContents* web_contents, | 300 SadTab* SadTab::Create(content::WebContents* web_contents, |
| 301 SadTabKind kind) { | 301 SadTabKind kind) { |
| 302 return new SadTabView(web_contents, kind); | 302 return new SadTabView(web_contents, kind); |
| 303 } | 303 } |
| 304 | 304 |
| 305 } // namespace chrome | 305 } // namespace chrome |
| OLD | NEW |