OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/ui/views/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1495 GetWindowTitle()); | 1495 GetWindowTitle()); |
1496 } | 1496 } |
1497 return GetWindowTitle(); | 1497 return GetWindowTitle(); |
1498 } | 1498 } |
1499 | 1499 |
1500 views::View* BrowserView::GetInitiallyFocusedView() { | 1500 views::View* BrowserView::GetInitiallyFocusedView() { |
1501 return NULL; | 1501 return NULL; |
1502 } | 1502 } |
1503 | 1503 |
1504 bool BrowserView::ShouldShowWindowTitle() const { | 1504 bool BrowserView::ShouldShowWindowTitle() const { |
1505 #if defined(USE_ASH) | |
1506 // For Ash only, app host windows do not show an icon, crbug.com/119411. | 1505 // For Ash only, app host windows do not show an icon, crbug.com/119411. |
1507 // Child windows (i.e. popups) do show an icon. | 1506 // Child windows (i.e. popups) do show an icon. |
1508 if (browser_->is_app() && browser_->app_type() == Browser::APP_TYPE_HOST) | 1507 if (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH && |
| 1508 browser_->is_app() && browser_->app_type() == Browser::APP_TYPE_HOST) |
1509 return false; | 1509 return false; |
1510 #endif | 1510 |
1511 return browser_->SupportsWindowFeature(Browser::FEATURE_TITLEBAR); | 1511 return browser_->SupportsWindowFeature(Browser::FEATURE_TITLEBAR); |
1512 } | 1512 } |
1513 | 1513 |
1514 gfx::ImageSkia BrowserView::GetWindowAppIcon() { | 1514 gfx::ImageSkia BrowserView::GetWindowAppIcon() { |
1515 if (browser_->is_app()) { | 1515 if (browser_->is_app()) { |
1516 WebContents* contents = browser_->tab_strip_model()->GetActiveWebContents(); | 1516 WebContents* contents = browser_->tab_strip_model()->GetActiveWebContents(); |
1517 extensions::TabHelper* extensions_tab_helper = | 1517 extensions::TabHelper* extensions_tab_helper = |
1518 contents ? extensions::TabHelper::FromWebContents(contents) : NULL; | 1518 contents ? extensions::TabHelper::FromWebContents(contents) : NULL; |
1519 if (extensions_tab_helper && extensions_tab_helper->GetExtensionAppIcon()) | 1519 if (extensions_tab_helper && extensions_tab_helper->GetExtensionAppIcon()) |
1520 return gfx::ImageSkia::CreateFrom1xBitmap( | 1520 return gfx::ImageSkia::CreateFrom1xBitmap( |
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2682 // The +1 in the next line creates a 1-px gap between icon and arrow tip. | 2682 // The +1 in the next line creates a 1-px gap between icon and arrow tip. |
2683 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - | 2683 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - |
2684 LocationBarView::kIconInternalPadding + 1); | 2684 LocationBarView::kIconInternalPadding + 1); |
2685 ConvertPointToTarget(location_icon_view, this, &icon_bottom); | 2685 ConvertPointToTarget(location_icon_view, this, &icon_bottom); |
2686 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2686 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
2687 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2687 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
2688 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2688 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
2689 } | 2689 } |
2690 return top_arrow_height; | 2690 return top_arrow_height; |
2691 } | 2691 } |
OLD | NEW |