| Index: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
|
| diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
|
| index d634b9e4ffbd844a613c005b73c0b8a70f362c79..6acebe302e9ce1df9dbc89dd9093986675ba52d6 100644
|
| --- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
|
| +++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
|
| @@ -44,6 +44,7 @@
|
| #import "chrome/browser/ui/cocoa/location_bar/page_action_decoration.h"
|
| #import "chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.h"
|
| #import "chrome/browser/ui/cocoa/location_bar/star_decoration.h"
|
| +#import "chrome/browser/ui/cocoa/location_bar/zoom_decoration.h"
|
| #import "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h"
|
| #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h"
|
| #include "chrome/browser/ui/content_settings/content_setting_image_model.h"
|
| @@ -97,6 +98,7 @@ LocationBarViewMac::LocationBarViewMac(
|
| OmniboxViewMac::GetFieldFont())),
|
| star_decoration_(new StarDecoration(command_updater)),
|
| chrome_to_mobile_decoration_(nil),
|
| + zoom_decoration_(new ZoomDecoration(toolbar_model)),
|
| keyword_hint_decoration_(
|
| new KeywordHintDecoration(OmniboxViewMac::GetFieldFont())),
|
| profile_(profile),
|
| @@ -240,6 +242,8 @@ void LocationBarViewMac::Update(const WebContents* contents,
|
| command_updater_->UpdateCommandEnabled(IDC_BOOKMARK_PAGE, star_enabled);
|
| star_decoration_->SetVisible(star_enabled);
|
| UpdateChromeToMobileEnabled();
|
| + const TabContents* tc = TabContents::FromWebContents(contents);
|
| + zoom_decoration_->Update(tc->zoom_controller());
|
| RefreshPageActionDecorations();
|
| RefreshContentSettingsDecorations();
|
| // OmniboxView restores state if the tab is non-NULL.
|
| @@ -452,6 +456,7 @@ void LocationBarViewMac::SetEditable(bool editable) {
|
| [field_ setEditable:editable ? YES : NO];
|
| star_decoration_->SetVisible(IsStarEnabled());
|
| UpdateChromeToMobileEnabled();
|
| + zoom_decoration_->Update(GetTabContents()->zoom_controller());
|
| UpdatePageActions();
|
| Layout();
|
| }
|
| @@ -460,9 +465,7 @@ bool LocationBarViewMac::IsEditable() {
|
| return [field_ isEditable] ? true : false;
|
| }
|
|
|
| -void LocationBarViewMac::SetStarred(bool starred) {
|
| - star_decoration_->SetStarred(starred);
|
| -
|
| +void LocationBarViewMac::OnImageDecorationsChanged() {
|
| // TODO(shess): The field-editor frame and cursor rects should not
|
| // change, here.
|
| [field_ updateCursorAndToolTipRects];
|
| @@ -470,14 +473,22 @@ void LocationBarViewMac::SetStarred(bool starred) {
|
| [field_ setNeedsDisplay:YES];
|
| }
|
|
|
| +void LocationBarViewMac::SetStarred(bool starred) {
|
| + star_decoration_->SetStarred(starred);
|
| + OnImageDecorationsChanged();
|
| +}
|
| +
|
| void LocationBarViewMac::SetChromeToMobileDecorationLit(bool lit) {
|
| chrome_to_mobile_decoration_->SetLit(lit);
|
| + OnImageDecorationsChanged();
|
| +}
|
|
|
| - // TODO(shess): The field-editor frame and cursor rects should not
|
| - // change, here.
|
| - [field_ updateCursorAndToolTipRects];
|
| - [field_ resetFieldEditorFrameIfNeeded];
|
| - [field_ setNeedsDisplay:YES];
|
| +void LocationBarViewMac::ZoomChangedForActiveTab(bool can_show_bubble) {
|
| + zoom_decoration_->Update(GetTabContents()->zoom_controller());
|
| + OnImageDecorationsChanged();
|
| +
|
| + //if (can_show_bubble)
|
| + // [controller_ showZoomBubble];
|
| }
|
|
|
| NSPoint LocationBarViewMac::GetBookmarkBubblePoint() const {
|
| @@ -641,6 +652,7 @@ void LocationBarViewMac::Layout() {
|
| [cell addLeftDecoration:selected_keyword_decoration_.get()];
|
| [cell addLeftDecoration:ev_bubble_decoration_.get()];
|
| [cell addRightDecoration:star_decoration_.get()];
|
| + [cell addRightDecoration:zoom_decoration_.get()];
|
| if (chrome_to_mobile_decoration_.get())
|
| [cell addRightDecoration:chrome_to_mobile_decoration_.get()];
|
|
|
|
|