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

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

Issue 1578021: Shift omnibox dropdown in and up on Windows, and square off the top, so it co... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 8 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "base/keyboard_codes.h" 7 #include "base/keyboard_codes.h"
8 #include "chrome/browser/views/bubble_border.h" 8 #include "chrome/browser/views/bubble_border.h"
9 #include "chrome/browser/window_sizer.h" 9 #include "chrome/browser/window_sizer.h"
10 #include "chrome/common/notification_service.h" 10 #include "chrome/common/notification_service.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 *contents_bounds = gfx::Rect(gfx::Point(), window_bounds->size()); 121 *contents_bounds = gfx::Rect(gfx::Point(), window_bounds->size());
122 gfx::Insets insets; 122 gfx::Insets insets;
123 bubble_border->GetInsets(&insets); 123 bubble_border->GetInsets(&insets);
124 contents_bounds->Inset(insets.left() + kLeftMargin, insets.top() + kTopMargin, 124 contents_bounds->Inset(insets.left() + kLeftMargin, insets.top() + kTopMargin,
125 insets.right() + kRightMargin, insets.bottom() + kBottomMargin); 125 insets.right() + kRightMargin, insets.bottom() + kBottomMargin);
126 } 126 }
127 127
128 void BorderContents::Paint(gfx::Canvas* canvas) { 128 void BorderContents::Paint(gfx::Canvas* canvas) {
129 // The border of this view creates an anti-aliased round-rect region for the 129 // The border of this view creates an anti-aliased round-rect region for the
130 // contents, which we need to fill with the background color. 130 // contents, which we need to fill with the background color.
131 // NOTE: This doesn't handle an arrow location of "NONE", which has square top
132 // corners.
131 SkPaint paint; 133 SkPaint paint;
132 paint.setAntiAlias(true); 134 paint.setAntiAlias(true);
133 paint.setStyle(SkPaint::kFill_Style); 135 paint.setStyle(SkPaint::kFill_Style);
134 paint.setColor(InfoBubble::kBackgroundColor); 136 paint.setColor(InfoBubble::kBackgroundColor);
135 gfx::Path path; 137 gfx::Path path;
136 gfx::Rect bounds(GetLocalBounds(false)); 138 gfx::Rect bounds(GetLocalBounds(false));
137 SkRect rect; 139 SkRect rect;
138 rect.set(SkIntToScalar(bounds.x()), SkIntToScalar(bounds.y()), 140 rect.set(SkIntToScalar(bounds.x()), SkIntToScalar(bounds.y()),
139 SkIntToScalar(bounds.right()), SkIntToScalar(bounds.bottom())); 141 SkIntToScalar(bounds.right()), SkIntToScalar(bounds.bottom()));
140 SkScalar radius = SkIntToScalar(BubbleBorder::GetCornerRadius()); 142 SkScalar radius = SkIntToScalar(BubbleBorder::GetCornerRadius());
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 #endif 349 #endif
348 } 350 }
349 351
350 bool InfoBubble::AcceleratorPressed(const views::Accelerator& accelerator) { 352 bool InfoBubble::AcceleratorPressed(const views::Accelerator& accelerator) {
351 if (!delegate_ || delegate_->CloseOnEscape()) { 353 if (!delegate_ || delegate_->CloseOnEscape()) {
352 Close(true); 354 Close(true);
353 return true; 355 return true;
354 } 356 }
355 return false; 357 return false;
356 } 358 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698