| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 browser_) { | 288 browser_) { |
| 289 action_box_button_view_ = new ActionBoxButtonView(browser_, profile_); | 289 action_box_button_view_ = new ActionBoxButtonView(browser_, profile_); |
| 290 AddChildView(action_box_button_view_); | 290 AddChildView(action_box_button_view_); |
| 291 } else if (browser_defaults::bookmarks_enabled && (mode_ == NORMAL)) { | 291 } else if (browser_defaults::bookmarks_enabled && (mode_ == NORMAL)) { |
| 292 // Note: condition above means that the star and ChromeToMobile icons are | 292 // Note: condition above means that the star and ChromeToMobile icons are |
| 293 // hidden in popups and in the app launcher. | 293 // hidden in popups and in the app launcher. |
| 294 star_view_ = new StarView(command_updater_); | 294 star_view_ = new StarView(command_updater_); |
| 295 AddChildView(star_view_); | 295 AddChildView(star_view_); |
| 296 star_view_->SetVisible(true); | 296 star_view_->SetVisible(true); |
| 297 | 297 |
| 298 // Disable Chrome To Mobile for off-the-record and non-synced profiles, | 298 // Also disable Chrome To Mobile for off-the-record and non-synced profiles, |
| 299 // or if the feature is disabled by a command line flag or chrome://flags. | 299 // or if the feature is disabled by a command line flag or chrome://flags. |
| 300 if (!profile_->IsOffTheRecord() && profile_->IsSyncAccessible() && | 300 if (!profile_->IsOffTheRecord() && profile_->IsSyncAccessible() && |
| 301 ChromeToMobileService::IsChromeToMobileEnabled()) { | 301 ChromeToMobileService::IsChromeToMobileEnabled()) { |
| 302 chrome_to_mobile_view_ = new ChromeToMobileView(this, command_updater_); | 302 chrome_to_mobile_view_ = new ChromeToMobileView(this, command_updater_); |
| 303 AddChildView(chrome_to_mobile_view_); | 303 AddChildView(chrome_to_mobile_view_); |
| 304 chrome_to_mobile_view_->SetVisible( | 304 ChromeToMobileService* service = |
| 305 ChromeToMobileServiceFactory::GetForProfile(profile_)->HasMobiles()); | 305 ChromeToMobileServiceFactory::GetForProfile(profile_); |
| 306 service->RequestMobileListUpdate(); |
| 307 chrome_to_mobile_view_->SetVisible(service->HasMobiles()); |
| 306 } | 308 } |
| 307 } | 309 } |
| 308 | 310 |
| 309 registrar_.Add(this, | 311 registrar_.Add(this, |
| 310 chrome::NOTIFICATION_EXTENSION_LOCATION_BAR_UPDATED, | 312 chrome::NOTIFICATION_EXTENSION_LOCATION_BAR_UPDATED, |
| 311 content::Source<Profile>(profile_)); | 313 content::Source<Profile>(profile_)); |
| 312 | 314 |
| 313 // Initialize the location entry. We do this to avoid a black flash which is | 315 // Initialize the location entry. We do this to avoid a black flash which is |
| 314 // visible when the location entry has just been initialized. | 316 // visible when the location entry has just been initialized. |
| 315 Update(NULL); | 317 Update(NULL); |
| (...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1514 } | 1516 } |
| 1515 | 1517 |
| 1516 void LocationBarView::CleanupFadeAnimation() { | 1518 void LocationBarView::CleanupFadeAnimation() { |
| 1517 // Since we're no longer animating we don't need our layer. | 1519 // Since we're no longer animating we don't need our layer. |
| 1518 SetPaintToLayer(false); | 1520 SetPaintToLayer(false); |
| 1519 // Bubble labels don't need a transparent background anymore. | 1521 // Bubble labels don't need a transparent background anymore. |
| 1520 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1522 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
| 1521 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1523 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
| 1522 } | 1524 } |
| 1523 #endif // USE_AURA | 1525 #endif // USE_AURA |
| OLD | NEW |