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 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1511 } | 1513 } |
1512 | 1514 |
1513 void LocationBarView::CleanupFadeAnimation() { | 1515 void LocationBarView::CleanupFadeAnimation() { |
1514 // Since we're no longer animating we don't need our layer. | 1516 // Since we're no longer animating we don't need our layer. |
1515 SetPaintToLayer(false); | 1517 SetPaintToLayer(false); |
1516 // Bubble labels don't need a transparent background anymore. | 1518 // Bubble labels don't need a transparent background anymore. |
1517 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1519 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
1518 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1520 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
1519 } | 1521 } |
1520 #endif // USE_AURA | 1522 #endif // USE_AURA |
OLD | NEW |