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