| OLD | NEW |
| 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/app_launcher.h" | 5 #include "chrome/browser/views/app_launcher.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 | 215 |
| 216 gfx::Size InfoBubbleContentsView::GetPreferredSize() { | 216 gfx::Size InfoBubbleContentsView::GetPreferredSize() { |
| 217 return preferred_size_; | 217 return preferred_size_; |
| 218 } | 218 } |
| 219 | 219 |
| 220 void InfoBubbleContentsView::Layout() { | 220 void InfoBubbleContentsView::Layout() { |
| 221 if (bounds().IsEmpty() || GetChildViewCount() == 0) | 221 if (bounds().IsEmpty() || GetChildViewCount() == 0) |
| 222 return; | 222 return; |
| 223 | 223 |
| 224 gfx::Rect bounds = GetLocalBounds(false); | 224 gfx::Rect bounds = GetLocalBounds(false); |
| 225 // The browser's location bar use a vertical padding that we need to take into | 225 // The browser's location bar uses vertical padding that we need to take into |
| 226 // account to match its height. | 226 // account to match its height. |
| 227 int location_bar_height = | 227 int location_bar_height = location_bar_->GetPreferredSize().height() - |
| 228 location_bar_->GetPreferredSize().height() - LocationBarView::kVertMargin; | 228 LocationBarView::kVerticalEdgeThickness; |
| 229 location_bar_->SetBounds(bounds.x(), bounds.y(), bounds.width(), | 229 location_bar_->SetBounds(bounds.x(), bounds.y(), bounds.width(), |
| 230 location_bar_height); | 230 location_bar_height); |
| 231 int render_y = location_bar_->bounds().bottom() + kNavigationBarBottomPadding; | 231 int render_y = location_bar_->bounds().bottom() + kNavigationBarBottomPadding; |
| 232 dom_view_->SetBounds(0, render_y, | 232 dom_view_->SetBounds(0, render_y, |
| 233 width(), app_launcher_->contents_pref_size_.height()); | 233 width(), app_launcher_->contents_pref_size_.height()); |
| 234 } | 234 } |
| 235 | 235 |
| 236 void InfoBubbleContentsView::ExecuteCommand(int id) { | 236 void InfoBubbleContentsView::ExecuteCommand(int id) { |
| 237 // The user navigated by typing or selecting an entry in the location bar. | 237 // The user navigated by typing or selecting an entry in the location bar. |
| 238 DCHECK_EQ(IDC_OPEN_CURRENT_URL, id); | 238 DCHECK_EQ(IDC_OPEN_CURRENT_URL, id); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 browser_->AddTabWithURL( | 388 browser_->AddTabWithURL( |
| 389 url, GURL(), transition, -1, | 389 url, GURL(), transition, -1, |
| 390 TabStripModel::ADD_SELECTED | TabStripModel::ADD_FORCE_INDEX, NULL, | 390 TabStripModel::ADD_SELECTED | TabStripModel::ADD_FORCE_INDEX, NULL, |
| 391 std::string()); | 391 std::string()); |
| 392 } | 392 } |
| 393 | 393 |
| 394 void AppLauncher::Resize(const gfx::Size& contents_size) { | 394 void AppLauncher::Resize(const gfx::Size& contents_size) { |
| 395 info_bubble_content_->ComputePreferredSize(contents_size); | 395 info_bubble_content_->ComputePreferredSize(contents_size); |
| 396 info_bubble_->SizeToContents(); | 396 info_bubble_->SizeToContents(); |
| 397 } | 397 } |
| OLD | NEW |