| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/i18n/number_formatting.h" | 10 #include "base/i18n/number_formatting.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 170 |
| 171 if (!is_display_mode_normal()) { | 171 if (!is_display_mode_normal()) { |
| 172 AddChildView(location_bar_); | 172 AddChildView(location_bar_); |
| 173 location_bar_->Init(); | 173 location_bar_->Init(); |
| 174 return; | 174 return; |
| 175 } | 175 } |
| 176 | 176 |
| 177 back_ = new BackButton( | 177 back_ = new BackButton( |
| 178 browser_->profile(), this, | 178 browser_->profile(), this, |
| 179 new BackForwardMenuModel(browser_, BackForwardMenuModel::BACKWARD_MENU)); | 179 new BackForwardMenuModel(browser_, BackForwardMenuModel::BACKWARD_MENU)); |
| 180 back_->set_hide_ink_drop_when_showing_context_menu(false); |
| 180 back_->set_triggerable_event_flags( | 181 back_->set_triggerable_event_flags( |
| 181 ui::EF_LEFT_MOUSE_BUTTON | ui::EF_MIDDLE_MOUSE_BUTTON); | 182 ui::EF_LEFT_MOUSE_BUTTON | ui::EF_MIDDLE_MOUSE_BUTTON); |
| 182 back_->set_tag(IDC_BACK); | 183 back_->set_tag(IDC_BACK); |
| 183 back_->SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_BACK)); | 184 back_->SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_BACK)); |
| 184 back_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_BACK)); | 185 back_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_BACK)); |
| 185 back_->set_id(VIEW_ID_BACK_BUTTON); | 186 back_->set_id(VIEW_ID_BACK_BUTTON); |
| 186 back_->Init(); | 187 back_->Init(); |
| 187 | 188 |
| 188 forward_ = new ToolbarButton( | 189 forward_ = new ToolbarButton( |
| 189 browser_->profile(), this, | 190 browser_->profile(), this, |
| 190 new BackForwardMenuModel(browser_, BackForwardMenuModel::FORWARD_MENU)); | 191 new BackForwardMenuModel(browser_, BackForwardMenuModel::FORWARD_MENU)); |
| 192 forward_->set_hide_ink_drop_when_showing_context_menu(false); |
| 191 forward_->set_triggerable_event_flags( | 193 forward_->set_triggerable_event_flags( |
| 192 ui::EF_LEFT_MOUSE_BUTTON | ui::EF_MIDDLE_MOUSE_BUTTON); | 194 ui::EF_LEFT_MOUSE_BUTTON | ui::EF_MIDDLE_MOUSE_BUTTON); |
| 193 forward_->set_tag(IDC_FORWARD); | 195 forward_->set_tag(IDC_FORWARD); |
| 194 forward_->SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_FORWARD)); | 196 forward_->SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_FORWARD)); |
| 195 forward_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_FORWARD)); | 197 forward_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_FORWARD)); |
| 196 forward_->set_id(VIEW_ID_FORWARD_BUTTON); | 198 forward_->set_id(VIEW_ID_FORWARD_BUTTON); |
| 197 forward_->Init(); | 199 forward_->Init(); |
| 198 | 200 |
| 199 reload_ = new ReloadButton(browser_->profile(), | 201 reload_ = new ReloadButton(browser_->profile(), |
| 200 browser_->command_controller()->command_updater()); | 202 browser_->command_controller()->command_updater()); |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 SchedulePaint(); | 798 SchedulePaint(); |
| 797 } | 799 } |
| 798 | 800 |
| 799 int ToolbarView::content_shadow_height() const { | 801 int ToolbarView::content_shadow_height() const { |
| 800 #if defined(USE_ASH) | 802 #if defined(USE_ASH) |
| 801 return GetLayoutConstant(TOOLBAR_CONTENT_SHADOW_HEIGHT_ASH); | 803 return GetLayoutConstant(TOOLBAR_CONTENT_SHADOW_HEIGHT_ASH); |
| 802 #else | 804 #else |
| 803 return GetLayoutConstant(TOOLBAR_CONTENT_SHADOW_HEIGHT); | 805 return GetLayoutConstant(TOOLBAR_CONTENT_SHADOW_HEIGHT); |
| 804 #endif | 806 #endif |
| 805 } | 807 } |
| OLD | NEW |