| 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" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 #import "chrome/browser/ui/cocoa/location_bar/star_decoration.h" | 47 #import "chrome/browser/ui/cocoa/location_bar/star_decoration.h" |
| 48 #import "chrome/browser/ui/cocoa/location_bar/web_intents_button_decoration.h" | 48 #import "chrome/browser/ui/cocoa/location_bar/web_intents_button_decoration.h" |
| 49 #import "chrome/browser/ui/cocoa/location_bar/zoom_decoration.h" | 49 #import "chrome/browser/ui/cocoa/location_bar/zoom_decoration.h" |
| 50 #import "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h" | 50 #import "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h" |
| 51 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" | 51 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" |
| 52 #include "chrome/browser/ui/content_settings/content_setting_image_model.h" | 52 #include "chrome/browser/ui/content_settings/content_setting_image_model.h" |
| 53 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" | 53 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" |
| 54 #include "chrome/browser/ui/omnibox/location_bar_util.h" | 54 #include "chrome/browser/ui/omnibox/location_bar_util.h" |
| 55 #import "chrome/browser/ui/omnibox/omnibox_popup_model.h" | 55 #import "chrome/browser/ui/omnibox/omnibox_popup_model.h" |
| 56 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 56 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 57 #include "chrome/browser/ui/zoom/zoom_controller.h" |
| 57 #include "chrome/common/chrome_notification_types.h" | 58 #include "chrome/common/chrome_notification_types.h" |
| 58 #include "chrome/common/chrome_switches.h" | 59 #include "chrome/common/chrome_switches.h" |
| 59 #include "chrome/common/extensions/extension.h" | 60 #include "chrome/common/extensions/extension.h" |
| 60 #include "chrome/common/extensions/extension_action.h" | 61 #include "chrome/common/extensions/extension_action.h" |
| 61 #include "chrome/common/extensions/extension_resource.h" | 62 #include "chrome/common/extensions/extension_resource.h" |
| 62 #include "chrome/common/extensions/extension_switch_utils.h" | 63 #include "chrome/common/extensions/extension_switch_utils.h" |
| 63 #include "chrome/common/pref_names.h" | 64 #include "chrome/common/pref_names.h" |
| 64 #include "content/public/browser/notification_service.h" | 65 #include "content/public/browser/notification_service.h" |
| 65 #include "content/public/browser/web_contents.h" | 66 #include "content/public/browser/web_contents.h" |
| 66 #include "grit/generated_resources.h" | 67 #include "grit/generated_resources.h" |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 command_updater_->UpdateCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE, | 760 command_updater_->UpdateCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE, |
| 760 [field_ isEditable] && !toolbar_model_->input_in_progress() && | 761 [field_ isEditable] && !toolbar_model_->input_in_progress() && |
| 761 chrome_to_mobile_service && chrome_to_mobile_service->HasMobiles()); | 762 chrome_to_mobile_service && chrome_to_mobile_service->HasMobiles()); |
| 762 } | 763 } |
| 763 | 764 |
| 764 void LocationBarViewMac::UpdateZoomDecoration() { | 765 void LocationBarViewMac::UpdateZoomDecoration() { |
| 765 TabContents* tab_contents = GetTabContents(); | 766 TabContents* tab_contents = GetTabContents(); |
| 766 if (!tab_contents) | 767 if (!tab_contents) |
| 767 return; | 768 return; |
| 768 | 769 |
| 769 zoom_decoration_->Update(tab_contents->zoom_controller()); | 770 ZoomController* zoom_controller = |
| 771 ZoomController::FromWebContents(tab_contents->web_contents()); |
| 772 zoom_decoration_->Update(zoom_controller); |
| 770 } | 773 } |
| 771 | 774 |
| 772 void LocationBarViewMac::UpdateStarDecorationVisibility() { | 775 void LocationBarViewMac::UpdateStarDecorationVisibility() { |
| 773 // If the action box is enabled, only show the star if it's lit. | 776 // If the action box is enabled, only show the star if it's lit. |
| 774 bool visible = IsStarEnabled(); | 777 bool visible = IsStarEnabled(); |
| 775 if (!star_decoration_->starred() && | 778 if (!star_decoration_->starred() && |
| 776 extensions::switch_utils::IsActionBoxEnabled()) | 779 extensions::switch_utils::IsActionBoxEnabled()) |
| 777 visible = false; | 780 visible = false; |
| 778 star_decoration_->SetVisible(visible); | 781 star_decoration_->SetVisible(visible); |
| 779 } | 782 } |
| 780 | 783 |
| 781 void LocationBarViewMac::UpdatePlusDecorationVisibility() { | 784 void LocationBarViewMac::UpdatePlusDecorationVisibility() { |
| 782 if (extensions::switch_utils::IsActionBoxEnabled()) { | 785 if (extensions::switch_utils::IsActionBoxEnabled()) { |
| 783 // If the action box is enabled, hide it when input is in progress. | 786 // If the action box is enabled, hide it when input is in progress. |
| 784 plus_decoration_->SetVisible(!toolbar_model_->input_in_progress()); | 787 plus_decoration_->SetVisible(!toolbar_model_->input_in_progress()); |
| 785 } | 788 } |
| 786 } | 789 } |
| OLD | NEW |