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

Side by Side Diff: chrome/browser/ui/panels/panel_browser_window_cocoa.mm

Issue 8775022: Add Panel::SetPanelBoundsInstantly for all platforms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix per feedback Created 9 years 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "chrome/browser/ui/panels/panel_browser_window_cocoa.h" 5 #include "chrome/browser/ui/panels/panel_browser_window_cocoa.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/tabs/tab_strip_model.h" 8 #include "chrome/browser/tabs/tab_strip_model.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_list.h" 10 #include "chrome/browser/ui/browser_list.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 // |bounds| is the platform-independent screen coordinates, with (0,0) at 103 // |bounds| is the platform-independent screen coordinates, with (0,0) at
104 // top-left of the primary screen. 104 // top-left of the primary screen.
105 void PanelBrowserWindowCocoa::SetPanelBounds(const gfx::Rect& bounds) { 105 void PanelBrowserWindowCocoa::SetPanelBounds(const gfx::Rect& bounds) {
106 if (bounds_ == bounds) 106 if (bounds_ == bounds)
107 return; 107 return;
108 108
109 bounds_ = bounds; 109 bounds_ = bounds;
110 110
111 NSRect frame = ConvertCoordinatesToCocoa(bounds); 111 NSRect frame = ConvertCoordinatesToCocoa(bounds);
112 [controller_ setPanelFrame:frame]; 112 [controller_ setPanelFrame:frame animate:true];
Dmitry Titov 2011/12/01 20:52:50 should be animate:YES in Obj-C code
113 }
114
115 void PanelBrowserWindowCocoa::SetPanelBoundsInstantly(const gfx::Rect& bounds) {
jennb 2011/12/01 20:52:37 Could you use the same pattern here as you did for
116 if (bounds_ == bounds)
117 return;
118
119 bounds_ = bounds;
120
121 NSRect frame = ConvertCoordinatesToCocoa(bounds);
122 [controller_ setPanelFrame:frame animate:false];
Dmitry Titov 2011/12/01 20:52:50 animate:NO
113 } 123 }
114 124
115 void PanelBrowserWindowCocoa::ClosePanel() { 125 void PanelBrowserWindowCocoa::ClosePanel() {
116 if (isClosed()) 126 if (isClosed())
117 return; 127 return;
118 128
119 NSWindow* window = [controller_ window]; 129 NSWindow* window = [controller_ window];
120 [window performClose:controller_]; 130 [window performClose:controller_];
121 } 131 }
122 132
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 return false; 359 return false;
350 } 360 }
351 361
352 bool NativePanelTestingCocoa::IsWindowSizeKnown() const { 362 bool NativePanelTestingCocoa::IsWindowSizeKnown() const {
353 return true; 363 return true;
354 } 364 }
355 365
356 bool NativePanelTestingCocoa::IsAnimatingBounds() const { 366 bool NativePanelTestingCocoa::IsAnimatingBounds() const {
357 return [native_panel_window_->controller_ isAnimatingBounds]; 367 return [native_panel_window_->controller_ isAnimatingBounds];
358 } 368 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698