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

Side by Side Diff: chrome/browser/ui/cocoa/translate/translate_bubble_controller.mm

Issue 2270913002: fix icon toggling off bug by removing the line that disable window animation Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unit test breakage which was shadowed by the disable of window animation Created 4 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/translate/translate_manager_render_view_host_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/translate/translate_bubble_controller.h" 5 #import "chrome/browser/ui/cocoa/translate/translate_bubble_controller.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/mac/foundation_util.h" 9 #include "base/mac/foundation_util.h"
10 #include "base/mac/scoped_nsobject.h" 10 #include "base/mac/scoped_nsobject.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 NSWindow* parentWindow = [controller window]; 143 NSWindow* parentWindow = [controller window];
144 144
145 // Use an arbitrary size; it will be changed in performLayout. 145 // Use an arbitrary size; it will be changed in performLayout.
146 NSRect contentRect = ui::kWindowSizeDeterminedLater; 146 NSRect contentRect = ui::kWindowSizeDeterminedLater;
147 base::scoped_nsobject<InfoBubbleWindow> window( 147 base::scoped_nsobject<InfoBubbleWindow> window(
148 [[InfoBubbleWindow alloc] initWithContentRect:contentRect 148 [[InfoBubbleWindow alloc] initWithContentRect:contentRect
149 styleMask:NSBorderlessWindowMask 149 styleMask:NSBorderlessWindowMask
150 backing:NSBackingStoreBuffered 150 backing:NSBackingStoreBuffered
151 defer:NO]); 151 defer:NO]);
152 152
153 // Disable animations - otherwise, the window/controller will outlive the web
154 // contents it's associated with.
155 [window setAllowedAnimations:info_bubble::kAnimateNone];
156
157 if ((self = [super initWithWindow:window 153 if ((self = [super initWithWindow:window
158 parentWindow:parentWindow 154 parentWindow:parentWindow
159 anchoredAt:NSZeroPoint])) { 155 anchoredAt:NSZeroPoint])) {
160 webContents_ = webContents; 156 webContents_ = webContents;
161 model_ = std::move(model); 157 model_ = std::move(model);
162 158
163 shouldAlwaysTranslate_ = model_->ShouldAlwaysTranslate(); 159 shouldAlwaysTranslate_ = model_->ShouldAlwaysTranslate();
164 if (!webContents_->GetBrowserContext()->IsOffTheRecord()) { 160 if (!webContents_->GetBrowserContext()->IsOffTheRecord()) {
165 shouldAlwaysTranslate_ = 161 shouldAlwaysTranslate_ =
166 model_->ShouldAlwaysTranslateBeCheckedByDefault(); 162 model_->ShouldAlwaysTranslateBeCheckedByDefault();
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 // source or target language on the before translate view. 875 // source or target language on the before translate view.
880 - (BOOL)textView:(NSTextView*)aTextView 876 - (BOOL)textView:(NSTextView*)aTextView
881 clickedOnLink:(id)link 877 clickedOnLink:(id)link
882 atIndex:(NSUInteger)charIndex { 878 atIndex:(NSUInteger)charIndex {
883 translate::ReportUiAction(translate::ADVANCED_LINK_CLICKED); 879 translate::ReportUiAction(translate::ADVANCED_LINK_CLICKED);
884 [self switchView:TranslateBubbleModel::VIEW_STATE_ADVANCED]; 880 [self switchView:TranslateBubbleModel::VIEW_STATE_ADVANCED];
885 return YES; 881 return YES;
886 } 882 }
887 883
888 @end 884 @end
OLDNEW
« no previous file with comments | « chrome/browser/translate/translate_manager_render_view_host_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698