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

Side by Side Diff: chrome/browser/views/info_bubble.cc

Issue 145006: Fix the first run infobubble. It overrode WidgetWin's OnSize without calling ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 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
« no previous file with comments | « no previous file | 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 (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/views/info_bubble.h" 5 #include "chrome/browser/views/info_bubble.h"
6 6
7 #include "app/gfx/canvas.h" 7 #include "app/gfx/canvas.h"
8 #include "app/gfx/path.h" 8 #include "app/gfx/path.h"
9 #include "app/resource_bundle.h" 9 #include "app/resource_bundle.h"
10 #include "chrome/browser/browser_window.h" 10 #include "chrome/browser/browser_window.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 } else if (action == WA_ACTIVE) { 211 } else if (action == WA_ACTIVE) {
212 DCHECK(GetRootView()->GetChildViewCount() > 0); 212 DCHECK(GetRootView()->GetChildViewCount() > 0);
213 GetRootView()->GetChildViewAt(0)->RequestFocus(); 213 GetRootView()->GetChildViewAt(0)->RequestFocus();
214 } 214 }
215 } 215 }
216 216
217 void InfoBubble::OnSize(UINT param, const CSize& size) { 217 void InfoBubble::OnSize(UINT param, const CSize& size) {
218 gfx::Path path; 218 gfx::Path path;
219 content_view_->GetMask(gfx::Size(size.cx, size.cy), &path); 219 content_view_->GetMask(gfx::Size(size.cx, size.cy), &path);
220 SetWindowRgn(path.CreateHRGN(), TRUE); 220 SetWindowRgn(path.CreateHRGN(), TRUE);
221 WidgetWin::OnSize(param, size);
221 } 222 }
222 #endif 223 #endif
223 224
224 InfoBubble::ContentView* InfoBubble::CreateContentView(View* content) { 225 InfoBubble::ContentView* InfoBubble::CreateContentView(View* content) {
225 return new ContentView(content, this); 226 return new ContentView(content, this);
226 } 227 }
227 228
228 void InfoBubble::Close(bool closed_by_escape) { 229 void InfoBubble::Close(bool closed_by_escape) {
229 if (closed_) 230 if (closed_)
230 return; 231 return;
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 x -= kArrowXOffset; 450 x -= kArrowXOffset;
450 else 451 else
451 x = x + kArrowXOffset - pref.width(); 452 x = x + kArrowXOffset - pref.width();
452 if (IsTop()) { 453 if (IsTop()) {
453 y = position_relative_to.bottom() + kArrowToContentPadding; 454 y = position_relative_to.bottom() + kArrowToContentPadding;
454 } else { 455 } else {
455 y = position_relative_to.y() - kArrowToContentPadding - pref.height(); 456 y = position_relative_to.y() - kArrowToContentPadding - pref.height();
456 } 457 }
457 return gfx::Rect(x, y, pref.width(), pref.height()); 458 return gfx::Rect(x, y, pref.width(), pref.height());
458 } 459 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698