| 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/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| 11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 12 #include "base/sys_string_conversions.h" | 12 #include "base/sys_string_conversions.h" |
| 13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 14 #include "chrome/app/chrome_command_ids.h" | 14 #include "chrome/app/chrome_command_ids.h" |
| 15 #include "chrome/browser/alternate_nav_url_fetcher.h" | 15 #include "chrome/browser/alternate_nav_url_fetcher.h" |
| 16 #import "chrome/browser/app_controller_mac.h" | 16 #import "chrome/browser/app_controller_mac.h" |
| 17 #include "chrome/browser/chrome_to_mobile_service.h" | 17 #include "chrome/browser/chrome_to_mobile_service.h" |
| 18 #include "chrome/browser/chrome_to_mobile_service_factory.h" | 18 #include "chrome/browser/chrome_to_mobile_service_factory.h" |
| 19 #include "chrome/browser/command_updater.h" | 19 #include "chrome/browser/command_updater.h" |
| 20 #include "chrome/browser/defaults.h" | 20 #include "chrome/browser/defaults.h" |
| 21 #include "chrome/browser/extensions/api/tabs/tabs.h" | 21 #include "chrome/browser/extensions/api/tabs/tabs.h" |
| 22 #include "chrome/browser/extensions/extension_service.h" | 22 #include "chrome/browser/extensions/extension_service.h" |
| 23 #include "chrome/browser/extensions/location_bar_controller.h" | 23 #include "chrome/browser/extensions/location_bar_controller.h" |
| 24 #include "chrome/browser/extensions/tab_helper.h" | 24 #include "chrome/browser/extensions/tab_helper.h" |
| 25 #include "chrome/browser/prefs/pref_service.h" |
| 25 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
| 26 #include "chrome/browser/search_engines/template_url.h" | 27 #include "chrome/browser/search_engines/template_url.h" |
| 27 #include "chrome/browser/search_engines/template_url_service.h" | 28 #include "chrome/browser/search_engines/template_url_service.h" |
| 28 #include "chrome/browser/search_engines/template_url_service_factory.h" | 29 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 29 #include "chrome/browser/ui/browser_instant_controller.h" | 30 #include "chrome/browser/ui/browser_instant_controller.h" |
| 30 #include "chrome/browser/ui/browser_list.h" | 31 #include "chrome/browser/ui/browser_list.h" |
| 31 #include "chrome/browser/ui/browser_tabstrip.h" | 32 #include "chrome/browser/ui/browser_tabstrip.h" |
| 32 #import "chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.h
" | 33 #import "chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.h
" |
| 33 #include "chrome/browser/ui/cocoa/event_utils.h" | 34 #include "chrome/browser/ui/cocoa/event_utils.h" |
| 34 #import "chrome/browser/ui/cocoa/extensions/extension_action_context_menu.h" | 35 #import "chrome/browser/ui/cocoa/extensions/extension_action_context_menu.h" |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 void LocationBarViewMac::UpdateChromeToMobileEnabled() { | 745 void LocationBarViewMac::UpdateChromeToMobileEnabled() { |
| 745 if (!chrome_to_mobile_decoration_.get()) | 746 if (!chrome_to_mobile_decoration_.get()) |
| 746 return; | 747 return; |
| 747 | 748 |
| 748 DCHECK(ChromeToMobileService::IsChromeToMobileEnabled()); | 749 DCHECK(ChromeToMobileService::IsChromeToMobileEnabled()); |
| 749 bool enabled = [field_ isEditable] && !toolbar_model_->input_in_progress() && | 750 bool enabled = [field_ isEditable] && !toolbar_model_->input_in_progress() && |
| 750 ChromeToMobileServiceFactory::GetForProfile(profile_)->HasMobiles(); | 751 ChromeToMobileServiceFactory::GetForProfile(profile_)->HasMobiles(); |
| 751 chrome_to_mobile_decoration_->SetVisible(enabled); | 752 chrome_to_mobile_decoration_->SetVisible(enabled); |
| 752 command_updater_->UpdateCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE, enabled); | 753 command_updater_->UpdateCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE, enabled); |
| 753 } | 754 } |
| OLD | NEW |