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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 new EVBubbleDecoration(location_icon_decoration_.get())), | 97 new EVBubbleDecoration(location_icon_decoration_.get())), |
98 star_decoration_(new StarDecoration(command_updater)), | 98 star_decoration_(new StarDecoration(command_updater)), |
99 translate_decoration_(new TranslateDecoration(command_updater)), | 99 translate_decoration_(new TranslateDecoration(command_updater)), |
100 zoom_decoration_(new ZoomDecoration(this)), | 100 zoom_decoration_(new ZoomDecoration(this)), |
101 keyword_hint_decoration_(new KeywordHintDecoration()), | 101 keyword_hint_decoration_(new KeywordHintDecoration()), |
102 mic_search_decoration_(new MicSearchDecoration(command_updater)), | 102 mic_search_decoration_(new MicSearchDecoration(command_updater)), |
103 manage_passwords_decoration_( | 103 manage_passwords_decoration_( |
104 new ManagePasswordsDecoration(command_updater, this)), | 104 new ManagePasswordsDecoration(command_updater, this)), |
105 browser_(browser), | 105 browser_(browser), |
106 weak_ptr_factory_(this) { | 106 weak_ptr_factory_(this) { |
107 for (size_t i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { | 107 for (ContentSettingsType type : |
108 DCHECK_EQ(i, content_setting_decorations_.size()); | 108 ContentSettingBubbleModel::GetSupportedBubbleTypes()) { |
109 ContentSettingsType type = static_cast<ContentSettingsType>(i); | |
110 content_setting_decorations_.push_back( | 109 content_setting_decorations_.push_back( |
111 new ContentSettingDecoration(type, this, profile)); | 110 new ContentSettingDecoration(type, this, profile)); |
112 } | 111 } |
113 | 112 |
114 edit_bookmarks_enabled_.Init( | 113 edit_bookmarks_enabled_.Init( |
115 bookmarks::prefs::kEditBookmarksEnabled, profile->GetPrefs(), | 114 bookmarks::prefs::kEditBookmarksEnabled, profile->GetPrefs(), |
116 base::Bind(&LocationBarViewMac::OnEditBookmarksEnabledChanged, | 115 base::Bind(&LocationBarViewMac::OnEditBookmarksEnabledChanged, |
117 base::Unretained(this))); | 116 base::Unretained(this))); |
118 | 117 |
119 browser_->search_model()->AddObserver(this); | 118 browser_->search_model()->AddObserver(this); |
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 } | 714 } |
716 | 715 |
717 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { | 716 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { |
718 bool is_visible = !GetToolbarModel()->input_in_progress() && | 717 bool is_visible = !GetToolbarModel()->input_in_progress() && |
719 browser_->search_model()->voice_search_supported(); | 718 browser_->search_model()->voice_search_supported(); |
720 if (mic_search_decoration_->IsVisible() == is_visible) | 719 if (mic_search_decoration_->IsVisible() == is_visible) |
721 return false; | 720 return false; |
722 mic_search_decoration_->SetVisible(is_visible); | 721 mic_search_decoration_->SetVisible(is_visible); |
723 return true; | 722 return true; |
724 } | 723 } |
OLD | NEW |