OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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.h" | 9 #include "base/message_loop.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 keyword_hint_decoration_( | 105 keyword_hint_decoration_( |
106 new KeywordHintDecoration(OmniboxViewMac::GetFieldFont())), | 106 new KeywordHintDecoration(OmniboxViewMac::GetFieldFont())), |
107 profile_(profile), | 107 profile_(profile), |
108 browser_(browser), | 108 browser_(browser), |
109 toolbar_model_(toolbar_model), | 109 toolbar_model_(toolbar_model), |
110 transition_(content::PageTransitionFromInt( | 110 transition_(content::PageTransitionFromInt( |
111 content::PAGE_TRANSITION_TYPED | | 111 content::PAGE_TRANSITION_TYPED | |
112 content::PAGE_TRANSITION_FROM_ADDRESS_BAR)), | 112 content::PAGE_TRANSITION_FROM_ADDRESS_BAR)), |
113 weak_ptr_factory_(this) { | 113 weak_ptr_factory_(this) { |
114 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableActionBox)) { | 114 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableActionBox)) { |
115 plus_decoration_.reset(new PlusDecoration(this, command_updater, browser_)); | 115 plus_decoration_.reset(new PlusDecoration(this, browser_)); |
116 } | 116 } |
117 | 117 |
118 for (size_t i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { | 118 for (size_t i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { |
119 DCHECK_EQ(i, content_setting_decorations_.size()); | 119 DCHECK_EQ(i, content_setting_decorations_.size()); |
120 ContentSettingsType type = static_cast<ContentSettingsType>(i); | 120 ContentSettingsType type = static_cast<ContentSettingsType>(i); |
121 content_setting_decorations_.push_back( | 121 content_setting_decorations_.push_back( |
122 new ContentSettingDecoration(type, this, profile_)); | 122 new ContentSettingDecoration(type, this, profile_)); |
123 } | 123 } |
124 | 124 |
125 registrar_.Add(this, | 125 registrar_.Add(this, |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 | 741 |
742 void LocationBarViewMac::UpdateStarDecorationVisibility() { | 742 void LocationBarViewMac::UpdateStarDecorationVisibility() { |
743 bool action_box_enabled = | 743 bool action_box_enabled = |
744 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableActionBox); | 744 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableActionBox); |
745 // If the action box is enabled, only show the star if it's lit. | 745 // If the action box is enabled, only show the star if it's lit. |
746 bool visible = IsStarEnabled(); | 746 bool visible = IsStarEnabled(); |
747 if (!star_decoration_->starred() && action_box_enabled) | 747 if (!star_decoration_->starred() && action_box_enabled) |
748 visible = false; | 748 visible = false; |
749 star_decoration_->SetVisible(visible); | 749 star_decoration_->SetVisible(visible); |
750 } | 750 } |
OLD | NEW |