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

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

Issue 1171002: Some layout related fixes for the app launchers.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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/app_launcher.h ('k') | chrome/browser/views/tabs/tab_strip.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/app_launcher.cc
===================================================================
--- chrome/browser/views/app_launcher.cc (revision 42364)
+++ chrome/browser/views/app_launcher.cc (working copy)
@@ -343,13 +343,14 @@
gfx::Size InfoBubbleContentsView::GetPreferredSize() {
gfx::Rect bounds = app_launcher_->browser()->window()->GetRestoredBounds();
- return gfx::Size(bounds.width() * 2 / 3, bounds.width() * 4 / 5);
+ return gfx::Size(bounds.width() * 2 / 3, bounds.height() * 4 / 5);
}
void InfoBubbleContentsView::Layout() {
if (bounds().IsEmpty() || GetChildViewCount() == 0)
return;
+ gfx::Rect bounds = GetLocalBounds(false);
int navigation_bar_height =
kNavigationBarHeight + kNavigationEntryYMargin * 2;
const views::Border* border = navigation_bar_->border();
@@ -358,11 +359,12 @@
border->GetInsets(&insets);
navigation_bar_height += insets.height();
}
- navigation_bar_->SetBounds(x(), y(), width(), navigation_bar_height);
+ navigation_bar_->SetBounds(bounds.x(), bounds.y(),
+ bounds.width(), navigation_bar_height);
int render_y = navigation_bar_->bounds().bottom();
gfx::Size rwhv_size =
- gfx::Size(width(), std::max(0, height() - render_y + y()));
- render_view_container_->SetBounds(x(), render_y,
+ gfx::Size(width(), std::max(0, bounds.height() - render_y + bounds.y()));
+ render_view_container_->SetBounds(bounds.x(), render_y,
rwhv_size.width(), rwhv_size.height());
app_launcher_->rwhv_->SetSize(rwhv_size);
}
@@ -408,24 +410,27 @@
}
// static
-AppLauncher* AppLauncher::Show(Browser* browser) {
+AppLauncher* AppLauncher::Show(Browser* browser, const gfx::Rect& bounds) {
AppLauncher* app_launcher = new AppLauncher(browser);
+ BrowserView* browser_view = static_cast<BrowserView*>(browser->window());
+ app_launcher->info_bubble_ =
+ InfoBubble::Show(browser_view->frame()->GetWindow(), bounds,
+ app_launcher->info_bubble_content_, app_launcher);
+ app_launcher->info_bubble_content_->BubbleShown();
+ return app_launcher;
+}
+// static
+AppLauncher* AppLauncher::ShowForNewTab(Browser* browser) {
BrowserView* browser_view = static_cast<BrowserView*>(browser->window());
TabStrip* tabstrip = browser_view->tabstrip()->AsTabStrip();
- if (!tabstrip) {
- delete app_launcher;
+ if (!tabstrip)
return NULL;
- }
gfx::Rect bounds = tabstrip->GetNewTabButtonBounds();
gfx::Point origin = bounds.origin();
views::RootView::ConvertPointToScreen(tabstrip, &origin);
bounds.set_origin(origin);
- app_launcher->info_bubble_ =
- InfoBubble::Show(browser_view->frame()->GetWindow(), bounds,
- app_launcher->info_bubble_content_, app_launcher);
- app_launcher->info_bubble_content_->BubbleShown();
- return app_launcher;
+ return Show(browser, bounds);
}
void AppLauncher::Hide() {
« no previous file with comments | « chrome/browser/views/app_launcher.h ('k') | chrome/browser/views/tabs/tab_strip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698