| 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/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 browser_) { | 279 browser_) { |
| 280 action_box_button_view_ = new ActionBoxButtonView(browser_, profile_); | 280 action_box_button_view_ = new ActionBoxButtonView(browser_, profile_); |
| 281 AddChildView(action_box_button_view_); | 281 AddChildView(action_box_button_view_); |
| 282 } else if (browser_defaults::bookmarks_enabled && (mode_ == NORMAL)) { | 282 } else if (browser_defaults::bookmarks_enabled && (mode_ == NORMAL)) { |
| 283 // Note: condition above means that the star and ChromeToMobile icons are | 283 // Note: condition above means that the star and ChromeToMobile icons are |
| 284 // hidden in popups and in the app launcher. | 284 // hidden in popups and in the app launcher. |
| 285 star_view_ = new StarView(command_updater_); | 285 star_view_ = new StarView(command_updater_); |
| 286 AddChildView(star_view_); | 286 AddChildView(star_view_); |
| 287 star_view_->SetVisible(true); | 287 star_view_->SetVisible(true); |
| 288 | 288 |
| 289 // Also disable Chrome To Mobile for off-the-record and non-synced profiles, | 289 // Disable Chrome To Mobile for off-the-record and non-synced profiles, |
| 290 // or if the feature is disabled by a command line flag or chrome://flags. | 290 // or if the feature is disabled by a command line flag or chrome://flags. |
| 291 if (!profile_->IsOffTheRecord() && profile_->IsSyncAccessible() && | 291 if (!profile_->IsOffTheRecord() && profile_->IsSyncAccessible() && |
| 292 ChromeToMobileService::IsChromeToMobileEnabled()) { | 292 ChromeToMobileService::IsChromeToMobileEnabled()) { |
| 293 chrome_to_mobile_view_ = new ChromeToMobileView(this, command_updater_); | 293 chrome_to_mobile_view_ = new ChromeToMobileView(this, command_updater_); |
| 294 AddChildView(chrome_to_mobile_view_); | 294 AddChildView(chrome_to_mobile_view_); |
| 295 ChromeToMobileService* service = | 295 chrome_to_mobile_view_->SetVisible( |
| 296 ChromeToMobileServiceFactory::GetForProfile(profile_); | 296 ChromeToMobileServiceFactory::GetForProfile(profile_)->HasMobiles()); |
| 297 service->RequestMobileListUpdate(); | |
| 298 chrome_to_mobile_view_->SetVisible(service->HasMobiles()); | |
| 299 } | 297 } |
| 300 } | 298 } |
| 301 | 299 |
| 302 registrar_.Add(this, | 300 registrar_.Add(this, |
| 303 chrome::NOTIFICATION_EXTENSION_LOCATION_BAR_UPDATED, | 301 chrome::NOTIFICATION_EXTENSION_LOCATION_BAR_UPDATED, |
| 304 content::Source<Profile>(profile_)); | 302 content::Source<Profile>(profile_)); |
| 305 | 303 |
| 306 // Initialize the location entry. We do this to avoid a black flash which is | 304 // Initialize the location entry. We do this to avoid a black flash which is |
| 307 // visible when the location entry has just been initialized. | 305 // visible when the location entry has just been initialized. |
| 308 Update(NULL); | 306 Update(NULL); |
| (...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1505 } | 1503 } |
| 1506 | 1504 |
| 1507 void LocationBarView::CleanupFadeAnimation() { | 1505 void LocationBarView::CleanupFadeAnimation() { |
| 1508 // Since we're no longer animating we don't need our layer. | 1506 // Since we're no longer animating we don't need our layer. |
| 1509 SetPaintToLayer(false); | 1507 SetPaintToLayer(false); |
| 1510 // Bubble labels don't need a transparent background anymore. | 1508 // Bubble labels don't need a transparent background anymore. |
| 1511 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1509 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
| 1512 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1510 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
| 1513 } | 1511 } |
| 1514 #endif // USE_AURA | 1512 #endif // USE_AURA |
| OLD | NEW |