OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" | 5 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 browser_(browser), | 135 browser_(browser), |
136 weak_ptr_factory_(this) { | 136 weak_ptr_factory_(this) { |
137 for (size_t i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { | 137 for (size_t i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { |
138 DCHECK_EQ(i, content_setting_decorations_.size()); | 138 DCHECK_EQ(i, content_setting_decorations_.size()); |
139 ContentSettingsType type = static_cast<ContentSettingsType>(i); | 139 ContentSettingsType type = static_cast<ContentSettingsType>(i); |
140 content_setting_decorations_.push_back( | 140 content_setting_decorations_.push_back( |
141 new ContentSettingDecoration(type, this, profile)); | 141 new ContentSettingDecoration(type, this, profile)); |
142 } | 142 } |
143 | 143 |
144 edit_bookmarks_enabled_.Init( | 144 edit_bookmarks_enabled_.Init( |
145 prefs::kEditBookmarksEnabled, profile->GetPrefs(), | 145 bookmarks::prefs::kEditBookmarksEnabled, profile->GetPrefs(), |
146 base::Bind(&LocationBarViewMac::OnEditBookmarksEnabledChanged, | 146 base::Bind(&LocationBarViewMac::OnEditBookmarksEnabledChanged, |
147 base::Unretained(this))); | 147 base::Unretained(this))); |
148 | 148 |
149 browser_->search_model()->AddObserver(this); | 149 browser_->search_model()->AddObserver(this); |
150 | 150 |
151 [[field_ cell] setIsPopupMode: | 151 [[field_ cell] setIsPopupMode: |
152 !browser->SupportsWindowFeature(Browser::FEATURE_TABSTRIP)]; | 152 !browser->SupportsWindowFeature(Browser::FEATURE_TABSTRIP)]; |
153 | 153 |
154 if (chrome::ShouldDisplayOriginChip()) | 154 if (chrome::ShouldDisplayOriginChip()) |
155 origin_chip_decoration_.reset(new OriginChipDecoration( | 155 origin_chip_decoration_.reset(new OriginChipDecoration( |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 } | 758 } |
759 | 759 |
760 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { | 760 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { |
761 bool is_visible = !GetToolbarModel()->input_in_progress() && | 761 bool is_visible = !GetToolbarModel()->input_in_progress() && |
762 browser_->search_model()->voice_search_supported(); | 762 browser_->search_model()->voice_search_supported(); |
763 if (mic_search_decoration_->IsVisible() == is_visible) | 763 if (mic_search_decoration_->IsVisible() == is_visible) |
764 return false; | 764 return false; |
765 mic_search_decoration_->SetVisible(is_visible); | 765 mic_search_decoration_->SetVisible(is_visible); |
766 return true; | 766 return true; |
767 } | 767 } |
OLD | NEW |