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

Unified Diff: chrome/browser/views/info_bubble.cc

Issue 2060004: Removing the app launcher button on ChromeOS (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: One more clean up Created 10 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/views/info_bubble.h ('k') | chrome/browser/views/pinned_contents_info_bubble.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/info_bubble.cc
diff --git a/chrome/browser/views/info_bubble.cc b/chrome/browser/views/info_bubble.cc
index d141404089f48bfbb9eedbb4c8ff3094328630ca..d184c46bcf82b5cea66220bfd24605a87fe7b585 100644
--- a/chrome/browser/views/info_bubble.cc
+++ b/chrome/browser/views/info_bubble.cc
@@ -199,9 +199,9 @@ BorderWidget::BorderWidget() : border_contents_(NULL) {
}
-void BorderWidget::Init(HWND owner) {
+void BorderWidget::Init(BorderContents* border_contents, HWND owner) {
DCHECK(!border_contents_);
- border_contents_ = CreateBorderContents();
+ border_contents_ = border_contents;
border_contents_->Init();
WidgetWin::Init(GetAncestor(owner, GA_ROOT), gfx::Rect());
SetContentsView(border_contents_);
@@ -236,10 +236,6 @@ gfx::Rect BorderWidget::SizeAndGetBounds(
return contents_bounds;
}
-BorderContents* BorderWidget::CreateBorderContents() {
- return new BorderContents();
-}
-
LRESULT BorderWidget::OnMouseActivate(HWND window,
UINT hit_test,
UINT mouse_message) {
@@ -325,8 +321,8 @@ void InfoBubble::Init(views::Widget* parent,
#if defined(OS_WIN)
DCHECK(!border_.get());
- border_.reset(CreateBorderWidget());
- border_->Init(GetNativeView());
+ border_.reset(new BorderWidget());
+ border_->Init(CreateBorderContents(), GetNativeView());
// Initialize and position the border window.
window_bounds = border_->SizeAndGetBounds(position_relative_to,
@@ -341,7 +337,7 @@ void InfoBubble::Init(views::Widget* parent,
views::Background::CreateSolidBackground(kBackgroundColor));
#else
// Create a view to paint the border and background.
- border_contents_ = new BorderContents;
+ border_contents_ = CreateBorderContents();
border_contents_->Init();
gfx::Rect contents_bounds;
border_contents_->SizeAndGetBounds(position_relative_to,
@@ -375,11 +371,9 @@ void InfoBubble::Init(views::Widget* parent,
#endif
}
-#if defined(OS_WIN)
-BorderWidget* InfoBubble::CreateBorderWidget() {
- return new BorderWidget;
+BorderContents* InfoBubble::CreateBorderContents() {
+ return new BorderContents();
}
-#endif
void InfoBubble::SizeToContents() {
gfx::Rect window_bounds;
« no previous file with comments | « chrome/browser/views/info_bubble.h ('k') | chrome/browser/views/pinned_contents_info_bubble.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698