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 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 | 229 |
230 for (int i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { | 230 for (int i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { |
231 ContentSettingImageView* content_blocked_view = | 231 ContentSettingImageView* content_blocked_view = |
232 new ContentSettingImageView(static_cast<ContentSettingsType>(i), this); | 232 new ContentSettingImageView(static_cast<ContentSettingsType>(i), this); |
233 content_setting_views_.push_back(content_blocked_view); | 233 content_setting_views_.push_back(content_blocked_view); |
234 AddChildView(content_blocked_view); | 234 AddChildView(content_blocked_view); |
235 content_blocked_view->SetVisible(false); | 235 content_blocked_view->SetVisible(false); |
236 } | 236 } |
237 | 237 |
238 if (extensions::switch_utils::IsActionBoxEnabled()) { | 238 if (extensions::switch_utils::IsActionBoxEnabled()) { |
239 action_box_button_view_ = new ActionBoxButtonView( | 239 action_box_button_view_ = new ActionBoxButtonView(profile_); |
240 ExtensionSystem::Get(profile_)->extension_service()); | |
241 AddChildView(action_box_button_view_); | 240 AddChildView(action_box_button_view_); |
242 } else if (browser_defaults::bookmarks_enabled && (mode_ == NORMAL)) { | 241 } else if (browser_defaults::bookmarks_enabled && (mode_ == NORMAL)) { |
243 // Note: condition above means that the star and ChromeToMobile icons are | 242 // Note: condition above means that the star and ChromeToMobile icons are |
244 // hidden in popups and in the app launcher. | 243 // hidden in popups and in the app launcher. |
245 star_view_ = new StarView(command_updater_); | 244 star_view_ = new StarView(command_updater_); |
246 AddChildView(star_view_); | 245 AddChildView(star_view_); |
247 star_view_->SetVisible(true); | 246 star_view_->SetVisible(true); |
248 | 247 |
249 // Also disable Chrome To Mobile for off-the-record and non-synced profiles, | 248 // Also disable Chrome To Mobile for off-the-record and non-synced profiles, |
250 // or if the feature is disabled by a command line flag or chrome://flags. | 249 // or if the feature is disabled by a command line flag or chrome://flags. |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 i != page_action_views_.end(); ++i) { | 436 i != page_action_views_.end(); ++i) { |
438 if ((*i)->image_view()->page_action() == page_action) | 437 if ((*i)->image_view()->page_action() == page_action) |
439 return *i; | 438 return *i; |
440 } | 439 } |
441 return NULL; | 440 return NULL; |
442 } | 441 } |
443 | 442 |
444 void LocationBarView::SetStarToggled(bool on) { | 443 void LocationBarView::SetStarToggled(bool on) { |
445 if (star_view_) | 444 if (star_view_) |
446 star_view_->SetToggled(on); | 445 star_view_->SetToggled(on); |
| 446 if (action_box_button_view_) |
| 447 action_box_button_view_->SetBookmarkState(on); |
447 } | 448 } |
448 | 449 |
449 void LocationBarView::ShowStarBubble(const GURL& url, bool newly_bookmarked) { | 450 void LocationBarView::ShowStarBubble(const GURL& url, bool newly_bookmarked) { |
450 browser::ShowBookmarkBubbleView(star_view_, profile_, url, | 451 browser::ShowBookmarkBubbleView(star_view_, profile_, url, |
451 newly_bookmarked); | 452 newly_bookmarked); |
452 } | 453 } |
453 | 454 |
454 void LocationBarView::ShowChromeToMobileBubble() { | 455 void LocationBarView::ShowChromeToMobileBubble() { |
455 browser::ShowChromeToMobileBubbleView(chrome_to_mobile_view_, profile_); | 456 browser::ShowChromeToMobileBubbleView(chrome_to_mobile_view_, profile_); |
456 } | 457 } |
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1360 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && | 1361 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && |
1361 !suggested_text_view_->text().empty(); | 1362 !suggested_text_view_->text().empty(); |
1362 } | 1363 } |
1363 | 1364 |
1364 #if !defined(USE_AURA) | 1365 #if !defined(USE_AURA) |
1365 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { | 1366 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { |
1366 return static_cast<OmniboxViewWin*>(location_entry_.get()); | 1367 return static_cast<OmniboxViewWin*>(location_entry_.get()); |
1367 } | 1368 } |
1368 #endif | 1369 #endif |
1369 #endif | 1370 #endif |
OLD | NEW |