| 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 DeletePageActionDecorations(); | 229 DeletePageActionDecorations(); |
| 230 Layout(); | 230 Layout(); |
| 231 if (page_action_decorations_.size() != count_before) { | 231 if (page_action_decorations_.size() != count_before) { |
| 232 content::NotificationService::current()->Notify( | 232 content::NotificationService::current()->Notify( |
| 233 chrome::NOTIFICATION_EXTENSION_PAGE_ACTION_COUNT_CHANGED, | 233 chrome::NOTIFICATION_EXTENSION_PAGE_ACTION_COUNT_CHANGED, |
| 234 content::Source<LocationBar>(this), | 234 content::Source<LocationBar>(this), |
| 235 content::NotificationService::NoDetails()); | 235 content::NotificationService::NoDetails()); |
| 236 } | 236 } |
| 237 } | 237 } |
| 238 | 238 |
| 239 void LocationBarViewMac::UpdateWebIntentsButton() { |
| 240 // TODO(gbillock): Implement web intents tool for mac |
| 241 } |
| 242 |
| 239 void LocationBarViewMac::SaveStateToContents(WebContents* contents) { | 243 void LocationBarViewMac::SaveStateToContents(WebContents* contents) { |
| 240 // TODO(shess): Why SaveStateToContents vs SaveStateToTab? | 244 // TODO(shess): Why SaveStateToContents vs SaveStateToTab? |
| 241 omnibox_view_->SaveStateToTab(contents); | 245 omnibox_view_->SaveStateToTab(contents); |
| 242 } | 246 } |
| 243 | 247 |
| 244 void LocationBarViewMac::Update(const WebContents* contents, | 248 void LocationBarViewMac::Update(const WebContents* contents, |
| 245 bool should_restore_state) { | 249 bool should_restore_state) { |
| 246 bool star_enabled = IsStarEnabled(); | 250 bool star_enabled = IsStarEnabled(); |
| 247 command_updater_->UpdateCommandEnabled(IDC_BOOKMARK_PAGE, star_enabled); | 251 command_updater_->UpdateCommandEnabled(IDC_BOOKMARK_PAGE, star_enabled); |
| 248 star_decoration_->SetVisible(star_enabled); | 252 star_decoration_->SetVisible(star_enabled); |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 void LocationBarViewMac::UpdateChromeToMobileEnabled() { | 731 void LocationBarViewMac::UpdateChromeToMobileEnabled() { |
| 728 if (!chrome_to_mobile_decoration_.get()) | 732 if (!chrome_to_mobile_decoration_.get()) |
| 729 return; | 733 return; |
| 730 | 734 |
| 731 DCHECK(ChromeToMobileService::IsChromeToMobileEnabled()); | 735 DCHECK(ChromeToMobileService::IsChromeToMobileEnabled()); |
| 732 bool enabled = [field_ isEditable] && !toolbar_model_->input_in_progress() && | 736 bool enabled = [field_ isEditable] && !toolbar_model_->input_in_progress() && |
| 733 ChromeToMobileServiceFactory::GetForProfile(profile_)->HasMobiles(); | 737 ChromeToMobileServiceFactory::GetForProfile(profile_)->HasMobiles(); |
| 734 chrome_to_mobile_decoration_->SetVisible(enabled); | 738 chrome_to_mobile_decoration_->SetVisible(enabled); |
| 735 command_updater_->UpdateCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE, enabled); | 739 command_updater_->UpdateCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE, enabled); |
| 736 } | 740 } |
| OLD | NEW |