| OLD | NEW |
| 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/color_utils.h" | 8 #include "app/gfx/color_utils.h" |
| 9 #include "app/gfx/path.h" | 9 #include "app/gfx/path.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 #endif | 144 #endif |
| 145 | 145 |
| 146 NotificationService::current()->Notify(NotificationType::INFO_BUBBLE_CREATED, | 146 NotificationService::current()->Notify(NotificationType::INFO_BUBBLE_CREATED, |
| 147 Source<InfoBubble>(this), | 147 Source<InfoBubble>(this), |
| 148 NotificationService::NoDetails()); | 148 NotificationService::NoDetails()); |
| 149 | 149 |
| 150 // Show the window. | 150 // Show the window. |
| 151 #if defined(OS_WIN) | 151 #if defined(OS_WIN) |
| 152 ShowWindow(SW_SHOW); | 152 ShowWindow(SW_SHOW); |
| 153 #else | 153 #else |
| 154 Show(); | 154 views::WidgetGtk::Show(); |
| 155 #endif | 155 #endif |
| 156 } | 156 } |
| 157 | 157 |
| 158 InfoBubble::ContentView* InfoBubble::CreateContentView(View* content) { | 158 InfoBubble::ContentView* InfoBubble::CreateContentView(View* content) { |
| 159 return new ContentView(content, this); | 159 return new ContentView(content, this); |
| 160 } | 160 } |
| 161 | 161 |
| 162 #if defined(OS_WIN) | 162 #if defined(OS_WIN) |
| 163 void InfoBubble::OnActivate(UINT action, BOOL minimized, HWND window) { | 163 void InfoBubble::OnActivate(UINT action, BOOL minimized, HWND window) { |
| 164 // The popup should close when it is deactivated. | 164 // The popup should close when it is deactivated. |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 x -= kArrowXOffset; | 425 x -= kArrowXOffset; |
| 426 else | 426 else |
| 427 x = x + kArrowXOffset - pref.width(); | 427 x = x + kArrowXOffset - pref.width(); |
| 428 if (IsTop()) { | 428 if (IsTop()) { |
| 429 y = position_relative_to.bottom() + kArrowToContentPadding; | 429 y = position_relative_to.bottom() + kArrowToContentPadding; |
| 430 } else { | 430 } else { |
| 431 y = position_relative_to.y() - kArrowToContentPadding - pref.height(); | 431 y = position_relative_to.y() - kArrowToContentPadding - pref.height(); |
| 432 } | 432 } |
| 433 return gfx::Rect(x, y, pref.width(), pref.height()); | 433 return gfx::Rect(x, y, pref.width(), pref.height()); |
| 434 } | 434 } |
| OLD | NEW |