| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/compact_nav/compact_location_bar_view.h" | 5 #include "chrome/browser/ui/views/compact_nav/compact_location_bar_view.h" |
| 6 | 6 |
| 7 #if defined(TOOLKIT_USES_GTK) | 7 #if defined(TOOLKIT_USES_GTK) |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // Find out the right way, value for compact location bar. | 51 // Find out the right way, value for compact location bar. |
| 52 const int kDefaultLocationBarHeight = 34; | 52 const int kDefaultLocationBarHeight = 34; |
| 53 | 53 |
| 54 } // namespace | 54 } // namespace |
| 55 | 55 |
| 56 CompactLocationBarView::CompactLocationBarView(CompactLocationBarViewHost* host) | 56 CompactLocationBarView::CompactLocationBarView(CompactLocationBarViewHost* host) |
| 57 : DropdownBarView(host), | 57 : DropdownBarView(host), |
| 58 reload_button_(NULL), | 58 reload_button_(NULL), |
| 59 location_bar_view_(NULL), | 59 location_bar_view_(NULL), |
| 60 initialized_(false) { | 60 initialized_(false) { |
| 61 SetFocusable(true); | 61 set_focusable(true); |
| 62 } | 62 } |
| 63 | 63 |
| 64 CompactLocationBarView::~CompactLocationBarView() { | 64 CompactLocationBarView::~CompactLocationBarView() { |
| 65 } | 65 } |
| 66 | 66 |
| 67 //////////////////////////////////////////////////////////////////////////////// | 67 //////////////////////////////////////////////////////////////////////////////// |
| 68 // CompactLocationBarView public: | 68 // CompactLocationBarView public: |
| 69 | 69 |
| 70 void CompactLocationBarView::SetFocusAndSelection(bool select_all) { | 70 void CompactLocationBarView::SetFocusAndSelection(bool select_all) { |
| 71 location_bar_view_->FocusLocation(select_all); | 71 location_bar_view_->FocusLocation(select_all); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 118 |
| 119 // Reload button. | 119 // Reload button. |
| 120 reload_button_ = new ReloadButton(location_bar_view_, browser()); | 120 reload_button_ = new ReloadButton(location_bar_view_, browser()); |
| 121 reload_button_->set_triggerable_event_flags(ui::EF_LEFT_BUTTON_DOWN | | 121 reload_button_->set_triggerable_event_flags(ui::EF_LEFT_BUTTON_DOWN | |
| 122 ui::EF_MIDDLE_BUTTON_DOWN); | 122 ui::EF_MIDDLE_BUTTON_DOWN); |
| 123 reload_button_->set_tag(IDC_RELOAD); | 123 reload_button_->set_tag(IDC_RELOAD); |
| 124 reload_button_->SetTooltipText( | 124 reload_button_->SetTooltipText( |
| 125 UTF16ToWide(l10n_util::GetStringUTF16(IDS_TOOLTIP_RELOAD))); | 125 UTF16ToWide(l10n_util::GetStringUTF16(IDS_TOOLTIP_RELOAD))); |
| 126 reload_button_->SetAccessibleName( | 126 reload_button_->SetAccessibleName( |
| 127 l10n_util::GetStringUTF16(IDS_ACCNAME_RELOAD)); | 127 l10n_util::GetStringUTF16(IDS_ACCNAME_RELOAD)); |
| 128 reload_button_->SetID(VIEW_ID_RELOAD_BUTTON); | 128 reload_button_->set_id(VIEW_ID_RELOAD_BUTTON); |
| 129 | 129 |
| 130 ThemeProvider* tp = GetThemeProvider(); | 130 ThemeProvider* tp = GetThemeProvider(); |
| 131 reload_button_->SetImage(views::CustomButton::BS_NORMAL, | 131 reload_button_->SetImage(views::CustomButton::BS_NORMAL, |
| 132 tp->GetBitmapNamed(IDR_RELOAD)); | 132 tp->GetBitmapNamed(IDR_RELOAD)); |
| 133 reload_button_->SetImage(views::CustomButton::BS_HOT, | 133 reload_button_->SetImage(views::CustomButton::BS_HOT, |
| 134 tp->GetBitmapNamed(IDR_RELOAD_H)); | 134 tp->GetBitmapNamed(IDR_RELOAD_H)); |
| 135 reload_button_->SetImage(views::CustomButton::BS_PUSHED, | 135 reload_button_->SetImage(views::CustomButton::BS_PUSHED, |
| 136 tp->GetBitmapNamed(IDR_RELOAD_P)); | 136 tp->GetBitmapNamed(IDR_RELOAD_P)); |
| 137 reload_button_->SetToggledImage(views::CustomButton::BS_NORMAL, | 137 reload_button_->SetToggledImage(views::CustomButton::BS_NORMAL, |
| 138 tp->GetBitmapNamed(IDR_STOP)); | 138 tp->GetBitmapNamed(IDR_STOP)); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 323 |
| 324 InstantController* CompactLocationBarView::GetInstant() { | 324 InstantController* CompactLocationBarView::GetInstant() { |
| 325 // TODO(stevet): Re-enable instant for compact nav. | 325 // TODO(stevet): Re-enable instant for compact nav. |
| 326 // return browser()->instant(); | 326 // return browser()->instant(); |
| 327 return NULL; | 327 return NULL; |
| 328 } | 328 } |
| 329 | 329 |
| 330 TabContentsWrapper* CompactLocationBarView::GetTabContentsWrapper() const { | 330 TabContentsWrapper* CompactLocationBarView::GetTabContentsWrapper() const { |
| 331 return browser()->GetSelectedTabContentsWrapper(); | 331 return browser()->GetSelectedTabContentsWrapper(); |
| 332 } | 332 } |
| OLD | NEW |