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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 | 286 |
287 // Also disable Chrome To Mobile for off-the-record and non-synced profiles, | 287 // Also disable Chrome To Mobile for off-the-record and non-synced profiles, |
288 // or if the feature is disabled by a command line flag or chrome://flags. | 288 // or if the feature is disabled by a command line flag or chrome://flags. |
289 if (!profile_->IsOffTheRecord() && profile_->IsSyncAccessible() && | 289 if (!profile_->IsOffTheRecord() && profile_->IsSyncAccessible() && |
290 ChromeToMobileService::IsChromeToMobileEnabled()) { | 290 ChromeToMobileService::IsChromeToMobileEnabled()) { |
291 chrome_to_mobile_view_ = new ChromeToMobileView(this, command_updater_); | 291 chrome_to_mobile_view_ = new ChromeToMobileView(this, command_updater_); |
292 AddChildView(chrome_to_mobile_view_); | 292 AddChildView(chrome_to_mobile_view_); |
293 ChromeToMobileService* service = | 293 ChromeToMobileService* service = |
294 ChromeToMobileServiceFactory::GetForProfile(profile_); | 294 ChromeToMobileServiceFactory::GetForProfile(profile_); |
295 service->RequestMobileListUpdate(); | 295 service->RequestMobileListUpdate(); |
296 chrome_to_mobile_view_->SetVisible(service->HasDevices()); | 296 chrome_to_mobile_view_->SetVisible(service->HasMobiles()); |
297 } | 297 } |
298 } | 298 } |
299 | 299 |
300 registrar_.Add(this, | 300 registrar_.Add(this, |
301 chrome::NOTIFICATION_EXTENSION_LOCATION_BAR_UPDATED, | 301 chrome::NOTIFICATION_EXTENSION_LOCATION_BAR_UPDATED, |
302 content::Source<Profile>(profile_)); | 302 content::Source<Profile>(profile_)); |
303 | 303 |
304 // 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 |
305 // visible when the location entry has just been initialized. | 305 // visible when the location entry has just been initialized. |
306 Update(NULL); | 306 Update(NULL); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 RefreshPageActionViews(); | 400 RefreshPageActionViews(); |
401 | 401 |
402 bool star_enabled = star_view_ && !model_->input_in_progress() && | 402 bool star_enabled = star_view_ && !model_->input_in_progress() && |
403 edit_bookmarks_enabled_.GetValue(); | 403 edit_bookmarks_enabled_.GetValue(); |
404 | 404 |
405 command_updater_->UpdateCommandEnabled(IDC_BOOKMARK_PAGE, star_enabled); | 405 command_updater_->UpdateCommandEnabled(IDC_BOOKMARK_PAGE, star_enabled); |
406 if (star_view_) | 406 if (star_view_) |
407 star_view_->SetVisible(star_enabled); | 407 star_view_->SetVisible(star_enabled); |
408 | 408 |
409 bool enabled = chrome_to_mobile_view_ && !model_->input_in_progress() && | 409 bool enabled = chrome_to_mobile_view_ && !model_->input_in_progress() && |
410 ChromeToMobileServiceFactory::GetForProfile(profile_)->HasDevices(); | 410 ChromeToMobileServiceFactory::GetForProfile(profile_)->HasMobiles(); |
411 command_updater_->UpdateCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE, enabled); | 411 command_updater_->UpdateCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE, enabled); |
412 | 412 |
413 // Don't Update in app launcher mode so that the location entry does not show | 413 // Don't Update in app launcher mode so that the location entry does not show |
414 // a URL or security background. | 414 // a URL or security background. |
415 if (mode_ != APP_LAUNCHER) | 415 if (mode_ != APP_LAUNCHER) |
416 location_entry_->Update(tab_for_state_restoring); | 416 location_entry_->Update(tab_for_state_restoring); |
417 OnChanged(); | 417 OnChanged(); |
418 } | 418 } |
419 | 419 |
420 void LocationBarView::UpdateContentSettingsIcons() { | 420 void LocationBarView::UpdateContentSettingsIcons() { |
(...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1495 } | 1495 } |
1496 | 1496 |
1497 void LocationBarView::CleanupFadeAnimation() { | 1497 void LocationBarView::CleanupFadeAnimation() { |
1498 // Since we're no longer animating we don't need our layer. | 1498 // Since we're no longer animating we don't need our layer. |
1499 SetPaintToLayer(false); | 1499 SetPaintToLayer(false); |
1500 // Bubble labels don't need a transparent background anymore. | 1500 // Bubble labels don't need a transparent background anymore. |
1501 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1501 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
1502 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1502 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
1503 } | 1503 } |
1504 #endif // USE_AURA | 1504 #endif // USE_AURA |
OLD | NEW |