OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/shell/browser/shell.h" | 5 #include "content/shell/browser/shell.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // Add toolbar buttons and URL text field | 125 // Add toolbar buttons and URL text field |
126 { | 126 { |
127 layout->StartRow(0, 0); | 127 layout->StartRow(0, 0); |
128 views::GridLayout* toolbar_layout = new views::GridLayout(toolbar_view_); | 128 views::GridLayout* toolbar_layout = new views::GridLayout(toolbar_view_); |
129 toolbar_view_->SetLayoutManager(toolbar_layout); | 129 toolbar_view_->SetLayoutManager(toolbar_layout); |
130 | 130 |
131 views::ColumnSet* toolbar_column_set = | 131 views::ColumnSet* toolbar_column_set = |
132 toolbar_layout->AddColumnSet(0); | 132 toolbar_layout->AddColumnSet(0); |
133 // Back button | 133 // Back button |
134 back_button_ = | 134 back_button_ = |
135 views::MdTextButton::CreateMdButton(this, base::ASCIIToUTF16("Back")); | 135 views::MdTextButton::Create(this, base::ASCIIToUTF16("Back")); |
136 gfx::Size back_button_size = back_button_->GetPreferredSize(); | 136 gfx::Size back_button_size = back_button_->GetPreferredSize(); |
137 toolbar_column_set->AddColumn(views::GridLayout::CENTER, | 137 toolbar_column_set->AddColumn(views::GridLayout::CENTER, |
138 views::GridLayout::CENTER, 0, | 138 views::GridLayout::CENTER, 0, |
139 views::GridLayout::FIXED, | 139 views::GridLayout::FIXED, |
140 back_button_size.width(), | 140 back_button_size.width(), |
141 back_button_size.width() / 2); | 141 back_button_size.width() / 2); |
142 // Forward button | 142 // Forward button |
143 forward_button_ = views::MdTextButton::CreateMdButton( | 143 forward_button_ = |
144 this, base::ASCIIToUTF16("Forward")); | 144 views::MdTextButton::Create(this, base::ASCIIToUTF16("Forward")); |
145 gfx::Size forward_button_size = forward_button_->GetPreferredSize(); | 145 gfx::Size forward_button_size = forward_button_->GetPreferredSize(); |
146 toolbar_column_set->AddColumn(views::GridLayout::CENTER, | 146 toolbar_column_set->AddColumn(views::GridLayout::CENTER, |
147 views::GridLayout::CENTER, 0, | 147 views::GridLayout::CENTER, 0, |
148 views::GridLayout::FIXED, | 148 views::GridLayout::FIXED, |
149 forward_button_size.width(), | 149 forward_button_size.width(), |
150 forward_button_size.width() / 2); | 150 forward_button_size.width() / 2); |
151 // Refresh button | 151 // Refresh button |
152 refresh_button_ = views::MdTextButton::CreateMdButton( | 152 refresh_button_ = |
153 this, base::ASCIIToUTF16("Refresh")); | 153 views::MdTextButton::Create(this, base::ASCIIToUTF16("Refresh")); |
154 gfx::Size refresh_button_size = refresh_button_->GetPreferredSize(); | 154 gfx::Size refresh_button_size = refresh_button_->GetPreferredSize(); |
155 toolbar_column_set->AddColumn(views::GridLayout::CENTER, | 155 toolbar_column_set->AddColumn(views::GridLayout::CENTER, |
156 views::GridLayout::CENTER, 0, | 156 views::GridLayout::CENTER, 0, |
157 views::GridLayout::FIXED, | 157 views::GridLayout::FIXED, |
158 refresh_button_size.width(), | 158 refresh_button_size.width(), |
159 refresh_button_size.width() / 2); | 159 refresh_button_size.width() / 2); |
160 // Stop button | 160 // Stop button |
161 stop_button_ = | 161 stop_button_ = |
162 views::MdTextButton::CreateMdButton(this, base::ASCIIToUTF16("Stop")); | 162 views::MdTextButton::Create(this, base::ASCIIToUTF16("Stop")); |
163 gfx::Size stop_button_size = stop_button_->GetPreferredSize(); | 163 gfx::Size stop_button_size = stop_button_->GetPreferredSize(); |
164 toolbar_column_set->AddColumn(views::GridLayout::CENTER, | 164 toolbar_column_set->AddColumn(views::GridLayout::CENTER, |
165 views::GridLayout::CENTER, 0, | 165 views::GridLayout::CENTER, 0, |
166 views::GridLayout::FIXED, | 166 views::GridLayout::FIXED, |
167 stop_button_size.width(), | 167 stop_button_size.width(), |
168 stop_button_size.width() / 2); | 168 stop_button_size.width() / 2); |
169 toolbar_column_set->AddPaddingColumn(0, 2); | 169 toolbar_column_set->AddPaddingColumn(0, 2); |
170 // URL entry | 170 // URL entry |
171 url_entry_ = new views::Textfield(); | 171 url_entry_ = new views::Textfield(); |
172 url_entry_->set_controller(this); | 172 url_entry_->set_controller(this); |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 void Shell::PlatformSetTitle(const base::string16& title) { | 442 void Shell::PlatformSetTitle(const base::string16& title) { |
443 if (headless_) | 443 if (headless_) |
444 return; | 444 return; |
445 ShellWindowDelegateView* delegate_view = | 445 ShellWindowDelegateView* delegate_view = |
446 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); | 446 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); |
447 delegate_view->SetWindowTitle(title); | 447 delegate_view->SetWindowTitle(title); |
448 window_widget_->UpdateWindowTitle(); | 448 window_widget_->UpdateWindowTitle(); |
449 } | 449 } |
450 | 450 |
451 } // namespace content | 451 } // namespace content |
OLD | NEW |