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

Side by Side Diff: chrome/browser/ui/cocoa/location_bar/zoom_decoration.mm

Issue 301733006: Zoom Extension API (chrome) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix javascript test function signature. Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/zoom_decoration.h" 5 #import "chrome/browser/ui/cocoa/location_bar/zoom_decoration.h"
6 6
7 #include "base/strings/string16.h" 7 #include "base/strings/string16.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h" 10 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h"
(...skipping 17 matching lines...) Expand all
28 if (!ShouldShowDecoration()) { 28 if (!ShouldShowDecoration()) {
29 [bubble_ close]; 29 [bubble_ close];
30 SetVisible(false); 30 SetVisible(false);
31 return; 31 return;
32 } 32 }
33 33
34 SetImage(OmniboxViewMac::ImageForResource( 34 SetImage(OmniboxViewMac::ImageForResource(
35 zoom_controller->GetResourceForZoomLevel())); 35 zoom_controller->GetResourceForZoomLevel()));
36 36
37 base::string16 zoom_percent = 37 base::string16 zoom_percent =
38 base::IntToString16(zoom_controller->zoom_percent()); 38 base::IntToString16(zoom_controller->GetZoomPercent());
39 NSString* zoom_string = 39 NSString* zoom_string =
40 l10n_util::GetNSStringFWithFixup(IDS_TOOLTIP_ZOOM, zoom_percent); 40 l10n_util::GetNSStringFWithFixup(IDS_TOOLTIP_ZOOM, zoom_percent);
41 tooltip_.reset([zoom_string retain]); 41 tooltip_.reset([zoom_string retain]);
42 42
43 SetVisible(true); 43 SetVisible(true);
44 [bubble_ onZoomChanged]; 44 [bubble_ onZoomChanged];
45 } 45 }
46 46
47 void ZoomDecoration::ShowBubble(BOOL auto_close) { 47 void ZoomDecoration::ShowBubble(BOOL auto_close) {
48 if (bubble_) 48 if (bubble_)
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 bubble_ = nil; 115 bubble_ = nil;
116 116
117 // If the page is at default zoom then hiding the zoom decoration 117 // If the page is at default zoom then hiding the zoom decoration
118 // was suppressed while the bubble was open. Now that the bubble is 118 // was suppressed while the bubble was open. Now that the bubble is
119 // closed the decoration can be hidden. 119 // closed the decoration can be hidden.
120 if (IsAtDefaultZoom() && IsVisible()) { 120 if (IsAtDefaultZoom() && IsVisible()) {
121 SetVisible(false); 121 SetVisible(false);
122 owner_->OnDecorationsChanged(); 122 owner_->OnDecorationsChanged();
123 } 123 }
124 } 124 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698