OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/location_bar/location_bar_view.h" | 5 #include "chrome/browser/views/location_bar/location_bar_view.h" |
6 | 6 |
7 #if defined(OS_LINUX) | 7 #if defined(OS_LINUX) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 model_(model), | 91 model_(model), |
92 delegate_(delegate), | 92 delegate_(delegate), |
93 disposition_(CURRENT_TAB), | 93 disposition_(CURRENT_TAB), |
94 location_icon_view_(NULL), | 94 location_icon_view_(NULL), |
95 ev_bubble_view_(NULL), | 95 ev_bubble_view_(NULL), |
96 location_entry_view_(NULL), | 96 location_entry_view_(NULL), |
97 selected_keyword_view_(NULL), | 97 selected_keyword_view_(NULL), |
98 keyword_hint_view_(NULL), | 98 keyword_hint_view_(NULL), |
99 star_view_(NULL), | 99 star_view_(NULL), |
100 mode_(mode), | 100 mode_(mode), |
101 force_hidden_count_(0), | |
102 show_focus_rect_(false), | 101 show_focus_rect_(false), |
103 ALLOW_THIS_IN_INITIALIZER_LIST(first_run_bubble_(this)) { | 102 ALLOW_THIS_IN_INITIALIZER_LIST(first_run_bubble_(this)) { |
104 DCHECK(profile_); | 103 DCHECK(profile_); |
105 SetID(VIEW_ID_LOCATION_BAR); | 104 SetID(VIEW_ID_LOCATION_BAR); |
106 SetFocusable(true); | 105 SetFocusable(true); |
107 | 106 |
108 if (mode_ == NORMAL) | 107 if (mode_ == NORMAL) |
109 painter_.reset(new views::HorizontalPainter(kNormalModeBackgroundImages)); | 108 painter_.reset(new views::HorizontalPainter(kNormalModeBackgroundImages)); |
110 } | 109 } |
111 | 110 |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
981 } | 980 } |
982 | 981 |
983 void LocationBarView::SaveStateToContents(TabContents* contents) { | 982 void LocationBarView::SaveStateToContents(TabContents* contents) { |
984 location_entry_->SaveStateToTab(contents); | 983 location_entry_->SaveStateToTab(contents); |
985 } | 984 } |
986 | 985 |
987 void LocationBarView::Revert() { | 986 void LocationBarView::Revert() { |
988 location_entry_->RevertAll(); | 987 location_entry_->RevertAll(); |
989 } | 988 } |
990 | 989 |
991 void LocationBarView::PushForceHidden() { | |
992 #if defined(OS_WIN) | |
993 if (force_hidden_count_++ == 0) { | |
994 location_entry_->set_force_hidden(true); | |
995 ShowWindow(location_entry_->m_hWnd, SW_HIDE); | |
996 } | |
997 #endif | |
998 } | |
999 | |
1000 void LocationBarView::PopForceHidden() { | |
1001 #if defined(OS_WIN) | |
1002 if (force_hidden_count_ == 0) { | |
1003 NOTREACHED() << "Unmatched PopForceHidden() call!"; | |
1004 return; | |
1005 } | |
1006 if (--force_hidden_count_ == 0) { | |
1007 location_entry_->set_force_hidden(false); | |
1008 ShowWindow(location_entry_->m_hWnd, SW_SHOW); | |
1009 } | |
1010 #endif | |
1011 } | |
1012 | |
1013 int LocationBarView::PageActionVisibleCount() { | 990 int LocationBarView::PageActionVisibleCount() { |
1014 int result = 0; | 991 int result = 0; |
1015 for (size_t i = 0; i < page_action_views_.size(); i++) { | 992 for (size_t i = 0; i < page_action_views_.size(); i++) { |
1016 if (page_action_views_[i]->IsVisible()) | 993 if (page_action_views_[i]->IsVisible()) |
1017 ++result; | 994 ++result; |
1018 } | 995 } |
1019 return result; | 996 return result; |
1020 } | 997 } |
1021 | 998 |
1022 ExtensionAction* LocationBarView::GetPageAction(size_t index) { | 999 ExtensionAction* LocationBarView::GetPageAction(size_t index) { |
(...skipping 28 matching lines...) Expand all Loading... |
1051 page_action_views_[i]->image_view()->ExecuteAction(kLeftMouseButton, | 1028 page_action_views_[i]->image_view()->ExecuteAction(kLeftMouseButton, |
1052 false); // inspect_with_devtools | 1029 false); // inspect_with_devtools |
1053 return; | 1030 return; |
1054 } | 1031 } |
1055 ++current; | 1032 ++current; |
1056 } | 1033 } |
1057 } | 1034 } |
1058 | 1035 |
1059 NOTREACHED(); | 1036 NOTREACHED(); |
1060 } | 1037 } |
OLD | NEW |