| 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 "chrome/browser/ui/views/toolbar/toolbar_view.h" | 5 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/i18n/number_formatting.h" | 9 #include "base/i18n/number_formatting.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 218 |
| 219 home_ = new HomeButton(this, browser_); | 219 home_ = new HomeButton(this, browser_); |
| 220 home_->set_triggerable_event_flags( | 220 home_->set_triggerable_event_flags( |
| 221 ui::EF_LEFT_MOUSE_BUTTON | ui::EF_MIDDLE_MOUSE_BUTTON); | 221 ui::EF_LEFT_MOUSE_BUTTON | ui::EF_MIDDLE_MOUSE_BUTTON); |
| 222 home_->set_tag(IDC_HOME); | 222 home_->set_tag(IDC_HOME); |
| 223 home_->SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_HOME)); | 223 home_->SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_HOME)); |
| 224 home_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_HOME)); | 224 home_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_HOME)); |
| 225 home_->set_id(VIEW_ID_HOME_BUTTON); | 225 home_->set_id(VIEW_ID_HOME_BUTTON); |
| 226 home_->Init(); | 226 home_->Init(); |
| 227 | 227 |
| 228 browser_actions_ = new BrowserActionsContainer(browser_, this); | 228 browser_actions_ = new BrowserActionsContainer( |
| 229 browser_, |
| 230 this, // Owner. |
| 231 NULL); // No master container for this one (it is master). |
| 229 | 232 |
| 230 app_menu_ = new WrenchToolbarButton(this); | 233 app_menu_ = new WrenchToolbarButton(this); |
| 231 app_menu_->SetBorder(views::Border::NullBorder()); | 234 app_menu_->SetBorder(views::Border::NullBorder()); |
| 232 app_menu_->EnableCanvasFlippingForRTLUI(true); | 235 app_menu_->EnableCanvasFlippingForRTLUI(true); |
| 233 app_menu_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_APP)); | 236 app_menu_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_APP)); |
| 234 app_menu_->SetTooltipText(l10n_util::GetStringUTF16(IDS_APPMENU_TOOLTIP)); | 237 app_menu_->SetTooltipText(l10n_util::GetStringUTF16(IDS_APPMENU_TOOLTIP)); |
| 235 app_menu_->set_id(VIEW_ID_APP_MENU); | 238 app_menu_->set_id(VIEW_ID_APP_MENU); |
| 236 | 239 |
| 237 // Always add children in order from left to right, for accessibility. | 240 // Always add children in order from left to right, for accessibility. |
| 238 AddChildView(back_); | 241 AddChildView(back_); |
| (...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 | 842 |
| 840 void ToolbarView::OnShowHomeButtonChanged() { | 843 void ToolbarView::OnShowHomeButtonChanged() { |
| 841 Layout(); | 844 Layout(); |
| 842 SchedulePaint(); | 845 SchedulePaint(); |
| 843 } | 846 } |
| 844 | 847 |
| 845 int ToolbarView::content_shadow_height() const { | 848 int ToolbarView::content_shadow_height() const { |
| 846 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? | 849 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? |
| 847 kContentShadowHeightAsh : kContentShadowHeight; | 850 kContentShadowHeightAsh : kContentShadowHeight; |
| 848 } | 851 } |
| OLD | NEW |