| 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 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" | 5 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 } | 584 } |
| 585 return icons_updated; | 585 return icons_updated; |
| 586 } | 586 } |
| 587 | 587 |
| 588 void LocationBarViewMac::DeletePageActionDecorations() { | 588 void LocationBarViewMac::DeletePageActionDecorations() { |
| 589 // TODO(shess): Deleting these decorations could result in the cell | 589 // TODO(shess): Deleting these decorations could result in the cell |
| 590 // refering to them before things are laid out again. Meanwhile, at | 590 // refering to them before things are laid out again. Meanwhile, at |
| 591 // least fail safe. | 591 // least fail safe. |
| 592 [[field_ cell] clearDecorations]; | 592 [[field_ cell] clearDecorations]; |
| 593 | 593 |
| 594 page_action_decorations_.reset(); | 594 page_action_decorations_.clear(); |
| 595 } | 595 } |
| 596 | 596 |
| 597 void LocationBarViewMac::RefreshPageActionDecorations() { | 597 void LocationBarViewMac::RefreshPageActionDecorations() { |
| 598 if (!IsEditable()) { | 598 if (!IsEditable()) { |
| 599 DeletePageActionDecorations(); | 599 DeletePageActionDecorations(); |
| 600 return; | 600 return; |
| 601 } | 601 } |
| 602 | 602 |
| 603 TabContents* tab_contents = GetTabContents(); | 603 TabContents* tab_contents = GetTabContents(); |
| 604 if (!tab_contents) { | 604 if (!tab_contents) { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 void LocationBarViewMac::UpdateChromeToMobileEnabled() { | 719 void LocationBarViewMac::UpdateChromeToMobileEnabled() { |
| 720 if (!chrome_to_mobile_decoration_.get()) | 720 if (!chrome_to_mobile_decoration_.get()) |
| 721 return; | 721 return; |
| 722 | 722 |
| 723 DCHECK(ChromeToMobileService::IsChromeToMobileEnabled()); | 723 DCHECK(ChromeToMobileService::IsChromeToMobileEnabled()); |
| 724 bool enabled = [field_ isEditable] && !toolbar_model_->input_in_progress() && | 724 bool enabled = [field_ isEditable] && !toolbar_model_->input_in_progress() && |
| 725 ChromeToMobileServiceFactory::GetForProfile(profile_)->HasDevices(); | 725 ChromeToMobileServiceFactory::GetForProfile(profile_)->HasDevices(); |
| 726 chrome_to_mobile_decoration_->SetVisible(enabled); | 726 chrome_to_mobile_decoration_->SetVisible(enabled); |
| 727 command_updater_->UpdateCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE, enabled); | 727 command_updater_->UpdateCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE, enabled); |
| 728 } | 728 } |
| OLD | NEW |