Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7426)

Unified Diff: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm

Issue 10831372: Revert 152080 - Refactor browser window zoom handling and enable zoom icon on all platforms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
===================================================================
--- chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm (revision 152086)
+++ chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm (working copy)
@@ -44,7 +44,6 @@
#import "chrome/browser/ui/cocoa/location_bar/plus_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"
@@ -102,7 +101,6 @@
plus_decoration_(NULL),
star_decoration_(new StarDecoration(command_updater)),
chrome_to_mobile_decoration_(NULL),
- zoom_decoration_(new ZoomDecoration(toolbar_model)),
keyword_hint_decoration_(
new KeywordHintDecoration(OmniboxViewMac::GetFieldFont())),
profile_(profile),
@@ -254,7 +252,6 @@
command_updater_->UpdateCommandEnabled(IDC_BOOKMARK_PAGE, star_enabled);
star_decoration_->SetVisible(star_enabled);
UpdateChromeToMobileEnabled();
- UpdateZoomDecoration();
RefreshPageActionDecorations();
RefreshContentSettingsDecorations();
// OmniboxView restores state if the tab is non-NULL.
@@ -476,7 +473,6 @@
[field_ setEditable:editable ? YES : NO];
star_decoration_->SetVisible(IsStarEnabled());
UpdateChromeToMobileEnabled();
- UpdateZoomDecoration();
UpdatePageActions();
Layout();
}
@@ -485,7 +481,9 @@
return [field_ isEditable] ? true : false;
}
-void LocationBarViewMac::OnDecorationsChanged() {
+void LocationBarViewMac::SetStarred(bool starred) {
+ star_decoration_->SetStarred(starred);
+
// TODO(shess): The field-editor frame and cursor rects should not
// change, here.
[field_ updateCursorAndToolTipRects];
@@ -493,22 +491,14 @@
[field_ setNeedsDisplay:YES];
}
-void LocationBarViewMac::SetStarred(bool starred) {
- star_decoration_->SetStarred(starred);
- OnDecorationsChanged();
-}
-
void LocationBarViewMac::SetChromeToMobileDecorationLit(bool lit) {
chrome_to_mobile_decoration_->SetLit(lit);
- OnDecorationsChanged();
-}
-void LocationBarViewMac::ZoomChangedForActiveTab(bool can_show_bubble) {
- UpdateZoomDecoration();
- OnDecorationsChanged();
-
- // TODO(dbeam): show a zoom bubble when |can_show_bubble| is true, the zoom
- // decoration is showing, and the wrench menu isn't showing.
+ // TODO(shess): The field-editor frame and cursor rects should not
+ // change, here.
+ [field_ updateCursorAndToolTipRects];
+ [field_ resetFieldEditorFrameIfNeeded];
+ [field_ setNeedsDisplay:YES];
}
NSPoint LocationBarViewMac::GetBookmarkBubblePoint() const {
@@ -674,7 +664,6 @@
if (plus_decoration_.get())
[cell addRightDecoration:plus_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()];
@@ -728,7 +717,10 @@
// TODO(shess): Anytime the field editor might have changed, the
// cursor rects almost certainly should have changed. The tooltips
// might change even when the rects don't change.
- OnDecorationsChanged();
+ [field_ resetFieldEditorFrameIfNeeded];
+ [field_ updateCursorAndToolTipRects];
+
+ [field_ setNeedsDisplay:YES];
}
void LocationBarViewMac::RedrawDecoration(LocationBarDecoration* decoration) {
@@ -756,11 +748,3 @@
chrome_to_mobile_decoration_->SetVisible(enabled);
command_updater_->UpdateCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE, enabled);
}
-
-void LocationBarViewMac::UpdateZoomDecoration() {
- TabContents* tab_contents = GetTabContents();
- if (!tab_contents)
- return;
-
- zoom_decoration_->Update(tab_contents->zoom_controller());
-}
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h ('k') | chrome/browser/ui/cocoa/location_bar/zoom_decoration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698