diff options
-rw-r--r-- | chrome/browser/chromeos/frame/browser_frame_chromeos.cc | 12 | ||||
-rw-r--r-- | chrome/browser/chromeos/frame/browser_view.cc | 78 | ||||
-rw-r--r-- | chrome/browser/chromeos/frame/browser_view.h | 11 | ||||
-rw-r--r-- | chrome/browser/chromeos/frame/normal_browser_frame_view.cc | 375 | ||||
-rw-r--r-- | chrome/browser/chromeos/frame/normal_browser_frame_view.h | 94 | ||||
-rw-r--r-- | chrome/browser/chromeos/view_ids.h | 1 | ||||
-rw-r--r-- | chrome/chrome_browser.gypi | 2 |
7 files changed, 11 insertions, 562 deletions
diff --git a/chrome/browser/chromeos/frame/browser_frame_chromeos.cc b/chrome/browser/chromeos/frame/browser_frame_chromeos.cc index d55e6ce..c946924 100644 --- a/chrome/browser/chromeos/frame/browser_frame_chromeos.cc +++ b/chrome/browser/chromeos/frame/browser_frame_chromeos.cc @@ -4,10 +4,11 @@ #include "chrome/browser/chromeos/frame/browser_frame_chromeos.h" -#include "chrome/browser/chromeos/frame/normal_browser_frame_view.h" +#include "base/command_line.h" #include "chrome/browser/views/frame/browser_view.h" #include "chrome/browser/views/frame/opaque_browser_frame_view.h" #include "chrome/browser/views/frame/popup_non_client_frame_view.h" +#include "chrome/common/chrome_switches.h" // static (Factory method.) BrowserFrame* BrowserFrame::Create(BrowserView* browser_view, @@ -34,11 +35,6 @@ void BrowserFrameChromeos::Init() { if (IsPanel()) { // ChromeOS Panels should always use PopupNonClientFrameView. set_browser_frame_view(new PopupNonClientFrameView()); - } else if (!browser_view()->ShouldShowWindowIcon() && - !browser_view()->ShouldShowWindowTitle()) { - // Excludes a browser intance that requires icon/title. - // This is typically true for dev tools and javascript console. - set_browser_frame_view(new NormalBrowserFrameView(this, browser_view())); } else { // Default FrameView. set_browser_frame_view(new OpaqueBrowserFrameView(this, browser_view())); @@ -53,7 +49,9 @@ void BrowserFrameChromeos::Init() { } bool BrowserFrameChromeos::IsMaximized() const { - return !IsPanel() || WindowGtk::IsMaximized(); + if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeosFrame)) + return WindowGtk::IsMaximized(); + return !IsFullscreen() && (!IsPanel() || WindowGtk::IsMaximized()); } bool BrowserFrameChromeos::IsPanel() const { diff --git a/chrome/browser/chromeos/frame/browser_view.cc b/chrome/browser/chromeos/frame/browser_view.cc index 3bce13b..e11b9a2 100644 --- a/chrome/browser/chromeos/frame/browser_view.cc +++ b/chrome/browser/chromeos/frame/browser_view.cc @@ -32,7 +32,6 @@ #include "cros/chromeos_wm_ipc_enums.h" #include "views/controls/button/button.h" #include "views/controls/button/image_button.h" -#include "views/controls/image_view.h" #include "views/controls/menu/menu_2.h" #include "views/screen.h" #include "views/widget/root_view.h" @@ -41,15 +40,6 @@ namespace { -// The OTR avatar ends 2 px above the bottom of the tabstrip (which, given the -// way the tabstrip draws its bottom edge, will appear like a 1 px gap to the -// user). -const int kOTRBottomSpacing = 2; - -// There are 2 px on each side of the OTR avatar (between the frame border and -// it on the left, and between it and the tabstrip on the right). -const int kOTRSideSpacing = 2; - // Amount to offset the toolbar by when vertical tabs are enabled. const int kVerticalTabStripToolbarOffset = 2; @@ -82,9 +72,6 @@ class BrowserViewLayout : public ::BrowserViewLayout { case VIEW_ID_STATUS_AREA: status_area_ = static_cast<chromeos::StatusAreaView*>(view); break; - case VIEW_ID_OTR_AVATAR: - otr_avatar_icon_ = view; - break; } } @@ -94,7 +81,6 @@ class BrowserViewLayout : public ::BrowserViewLayout { virtual int LayoutTabStrip() { if (browser_view_->IsFullscreen() || !browser_view_->IsTabStripVisible()) { status_area_->SetVisible(false); - otr_avatar_icon_->SetVisible(false); tabstrip_->SetVisible(false); tabstrip_->SetBounds(0, 0, 0, 0); return 0; @@ -153,33 +139,20 @@ class BrowserViewLayout : public ::BrowserViewLayout { return false; } - // Positions the titlebar, toolbar, tabstrip, tabstrip and otr icon. This is + // Positions the titlebar, toolbar and tabstrip. This is // used when side tabs are enabled. int LayoutTitlebarComponentsWithVerticalTabs(const gfx::Rect& bounds) { if (bounds.IsEmpty()) return 0; tabstrip_->SetVisible(true); - otr_avatar_icon_->SetVisible(browser_view_->ShouldShowOffTheRecordAvatar()); status_area_->SetVisible(true); gfx::Size status_size = status_area_->GetPreferredSize(); int status_height = status_size.height(); - // Layout the otr icon. int status_x = bounds.x(); - if (!otr_avatar_icon_->IsVisible()) { - otr_avatar_icon_->SetBounds(0, 0, 0, 0); - } else { - gfx::Size otr_size = otr_avatar_icon_->GetPreferredSize(); - - status_height = std::max(status_height, otr_size.height()); - int y = bounds.bottom() - status_height; - otr_avatar_icon_->SetBounds(status_x, y, otr_size.width(), status_height); - status_x += otr_size.width(); - } - - // Layout the status area after the otr icon. + // Layout the status area. status_area_->SetBounds(status_x, bounds.bottom() - status_height, status_size.width(), status_height); @@ -210,56 +183,33 @@ class BrowserViewLayout : public ::BrowserViewLayout { return bounds.y() + toolbar_height; } - // Lays out components in the title bar area (given by |bounds|). These - // include the main menu, the otr avatar icon (in incognito windows), the - // tabstrip and the the status area. + // Lays out tabstrip and status area in the title bar area (given by + // |bounds|). int LayoutTitlebarComponents(const gfx::Rect& bounds) { if (bounds.IsEmpty()) return 0; tabstrip_->SetVisible(true); - otr_avatar_icon_->SetVisible(browser_view_->ShouldShowOffTheRecordAvatar()); status_area_->SetVisible(true); // Layout status area after tab strip. gfx::Size status_size = status_area_->GetPreferredSize(); status_area_->SetBounds(bounds.right() - status_size.width(), bounds.y(), status_size.width(), status_size.height()); - LayoutOTRAvatar(bounds); - tabstrip_->SetBounds(bounds.x(), bounds.y(), - std::max(0, otr_avatar_icon_->bounds().x() - bounds.x()), + std::max(0, status_area_->bounds().x() - bounds.x()), bounds.height()); return bounds.bottom(); } - // Layouts OTR avatar within the given |bounds|. - void LayoutOTRAvatar(const gfx::Rect& bounds) { - gfx::Rect status_bounds = status_area_->bounds(); - if (!otr_avatar_icon_->IsVisible()) { - otr_avatar_icon_->SetBounds(status_bounds.x(), status_bounds.y(), 0, 0); - } else { - gfx::Size preferred_size = otr_avatar_icon_->GetPreferredSize(); - - int y = bounds.bottom() - preferred_size.height() - kOTRBottomSpacing; - int x = status_bounds.x() - kOTRSideSpacing - preferred_size.width(); - otr_avatar_icon_->SetBounds(x, y, preferred_size.width(), - preferred_size.height()); - } - } - - chromeos::StatusAreaView* status_area_; - views::View* otr_avatar_icon_; DISALLOW_COPY_AND_ASSIGN(BrowserViewLayout); }; BrowserView::BrowserView(Browser* browser) : ::BrowserView(browser), - status_area_(NULL), - force_maximized_window_(false), - otr_avatar_icon_(new views::ImageView()) { + status_area_(NULL) { } BrowserView::~BrowserView() { @@ -283,10 +233,6 @@ void BrowserView::Init() { BrowserFrameGtk* gtk_frame = static_cast<BrowserFrameGtk*>(frame()); gtk_frame->GetNonClientView()->SetContextMenuController(this); - otr_avatar_icon_->SetImage(GetOTRAvatarIcon()); - otr_avatar_icon_->SetID(VIEW_ID_OTR_AVATAR); - AddChildView(otr_avatar_icon_); - // Make sure the window is set to the right type. std::vector<int> params; params.push_back(browser()->tab_count()); @@ -322,11 +268,6 @@ views::LayoutManager* BrowserView::CreateLayoutManager() const { return new BrowserViewLayout(); } -void BrowserView::InitTabStrip(TabStripModel* tab_strip_model) { - ::BrowserView::InitTabStrip(tab_strip_model); - UpdateOTRBackground(); -} - void BrowserView::ChildPreferredSizeChanged(View* child) { Layout(); SchedulePaint(); @@ -420,13 +361,6 @@ void BrowserView::InitSystemMenu() { system_menu_menu_.reset(new views::Menu2(system_menu_contents_.get())); } -void BrowserView::UpdateOTRBackground() { - if (UseVerticalTabs()) - otr_avatar_icon_->set_background(new ThemeBackground(this)); - else - otr_avatar_icon_->set_background(NULL); -} - } // namespace chromeos // static diff --git a/chrome/browser/chromeos/frame/browser_view.h b/chrome/browser/chromeos/frame/browser_view.h index 75f5892..3c81c12 100644 --- a/chrome/browser/chromeos/frame/browser_view.h +++ b/chrome/browser/chromeos/frame/browser_view.h @@ -50,7 +50,6 @@ class BrowserView : public ::BrowserView, virtual void Show(); virtual void FocusChromeOSStatus(); virtual views::LayoutManager* CreateLayoutManager() const; - virtual void InitTabStrip(TabStripModel* tab_strip_model); virtual void ChildPreferredSizeChanged(View* child); virtual bool GetSavedWindowBounds(gfx::Rect* bounds) const; @@ -76,10 +75,6 @@ class BrowserView : public ::BrowserView, private: void InitSystemMenu(); - // Updates the background of the otr icon. The background differs for vertical - // tabs. - void UpdateOTRBackground(); - // Status Area view. StatusAreaView* status_area_; @@ -87,12 +82,6 @@ class BrowserView : public ::BrowserView, scoped_ptr<menus::SimpleMenuModel> system_menu_contents_; scoped_ptr<views::Menu2> system_menu_menu_; - // A flag to specify if the browser window should be maximized. - bool force_maximized_window_; - - // Off the record icon. - views::ImageView* otr_avatar_icon_; - DISALLOW_COPY_AND_ASSIGN(BrowserView); }; diff --git a/chrome/browser/chromeos/frame/normal_browser_frame_view.cc b/chrome/browser/chromeos/frame/normal_browser_frame_view.cc deleted file mode 100644 index cd3f208..0000000 --- a/chrome/browser/chromeos/frame/normal_browser_frame_view.cc +++ /dev/null @@ -1,375 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/chromeos/frame/normal_browser_frame_view.h" - -#include "app/l10n_util.h" -#include "app/resource_bundle.h" -#include "app/theme_provider.h" -#include "base/command_line.h" -#include "base/compiler_specific.h" -#include "chrome/browser/tab_contents/tab_contents.h" -#include "chrome/browser/themes/browser_theme_provider.h" -#include "chrome/browser/views/frame/browser_frame.h" -#include "chrome/browser/views/frame/browser_view.h" -#include "chrome/browser/views/tabs/tab_strip.h" -#include "chrome/common/chrome_switches.h" -#include "gfx/canvas.h" -#include "gfx/font.h" -#include "gfx/path.h" -#include "grit/app_resources.h" -#include "grit/chromium_strings.h" -#include "grit/generated_resources.h" -#include "grit/theme_resources.h" -#include "views/controls/button/image_button.h" -#include "views/controls/image_view.h" -#include "views/window/hit_test.h" -#include "views/widget/root_view.h" -#include "views/window/window.h" -#include "views/window/window_resources.h" - -namespace { - -// The frame border is usually 0 as chromeos has no border. The border -// can be enabled (4px fixed) with the command line option -// "--chromeos-frame" so that one can resize the window on dev machine. -const int kFrameBorderThicknessForDev = 4; - -// While resize areas on Windows are normally the same size as the window -// borders, our top area is shrunk by 1 px to make it easier to move the window -// around with our thinner top grabbable strip. (Incidentally, our side and -// bottom resize areas don't match the frame border thickness either -- they -// span the whole nonclient area, so there's no "dead zone" for the mouse.) -const int kTopResizeAdjust = 1; - -// In the window corners, the resize areas don't actually expand bigger, but the -// 16 px at the end of each edge triggers diagonal resizing. -const int kResizeAreaCornerSize = 16; - -// The icon is inset 2 px from the left frame border. -const int kIconLeftSpacing = 2; - -// The top 1 px of the tabstrip is shadow; in maximized mode we push this off -// the top of the screen so the tabs appear flush against the screen edge. -const int kTabstripTopShadowThickness = 1; - -const int kCustomFrameBackgroundVerticalOffset = 15; - -} // namespace - -namespace chromeos { - -/////////////////////////////////////////////////////////////////////////////// -// NormalBrowserFrameView, public: - -NormalBrowserFrameView::NormalBrowserFrameView(BrowserFrame* frame, - BrowserView* browser_view) - : BrowserNonClientFrameView(), - frame_(frame), - browser_view_(browser_view) { - // Normal window does not have the window title/icon. - DCHECK(!browser_view_->ShouldShowWindowIcon()); - DCHECK(!browser_view_->ShouldShowWindowTitle()); - DCHECK(!frame_->GetWindow()->GetDelegate()->ShouldShowWindowTitle()); - DCHECK(!frame_->GetWindow()->GetDelegate()->ShouldShowWindowIcon()); -} - -NormalBrowserFrameView::~NormalBrowserFrameView() { -} - -/////////////////////////////////////////////////////////////////////////////// -// NormalBrowserFrameView, BrowserNonClientFrameView implementation: - -gfx::Rect NormalBrowserFrameView::GetBoundsForTabStrip( - BaseTabStrip* tabstrip) const { - int border_thickness = FrameBorderThickness(); - if (browser_view_->UseVerticalTabs()) { - // BrowserViewLayout adjusts the height/width based on the status area and - // otr icon. - gfx::Size ps = tabstrip->GetPreferredSize(); - return gfx::Rect(border_thickness, NonClientTopBorderHeight(), - ps.width(), browser_view_->height()); - } - return gfx::Rect(border_thickness, GetHorizontalTabStripVerticalOffset(false), - std::max(0, width() - (2 * border_thickness)), - tabstrip->GetPreferredHeight()); -} - -int NormalBrowserFrameView::GetHorizontalTabStripVerticalOffset( - bool restored) const { - return NonClientTopBorderHeight(); -} - -void NormalBrowserFrameView::UpdateThrobber(bool running) { - // No window icon. -} - -gfx::Size NormalBrowserFrameView::GetMinimumSize() { - gfx::Size min_size(browser_view_->GetMinimumSize()); - int border_thickness = FrameBorderThickness(); - min_size.Enlarge(2 * border_thickness, - NonClientTopBorderHeight() + border_thickness); - - int min_titlebar_width = (2 * border_thickness) + kIconLeftSpacing; - min_size.set_width(std::max(min_size.width(), min_titlebar_width)); - return min_size; -} - -/////////////////////////////////////////////////////////////////////////////// -// NormalBrowserFrameView, views::NonClientFrameView implementation: - -gfx::Rect NormalBrowserFrameView::GetBoundsForClientView() const { - return client_view_bounds_; -} - -bool NormalBrowserFrameView::AlwaysUseNativeFrame() const { - return frame_->AlwaysUseNativeFrame(); -} - -gfx::Rect NormalBrowserFrameView::GetWindowBoundsForClientBounds( - const gfx::Rect& client_bounds) const { - int top_height = NonClientTopBorderHeight(); - int border_thickness = FrameBorderThickness(); - return gfx::Rect(std::max(0, client_bounds.x() - border_thickness), - std::max(0, client_bounds.y() - top_height), - client_bounds.width() + (2 * border_thickness), - client_bounds.height() + top_height + border_thickness); -} - -int NormalBrowserFrameView::NonClientHitTest(const gfx::Point& point) { - if (!bounds().Contains(point)) - return HTNOWHERE; - int frame_component = - frame_->GetWindow()->GetClientView()->NonClientHitTest(point); - if (frame_component != HTNOWHERE) - return frame_component; - int border_thickness = FrameBorderThickness(); - int window_component = GetHTComponentForFrame(point, - std::max(0, border_thickness - kTopResizeAdjust), border_thickness, - kResizeAreaCornerSize, kResizeAreaCornerSize, - frame_->GetWindow()->GetDelegate()->CanResize()); - // Fall back to the caption if no other component matches. - return (window_component == HTNOWHERE) ? HTCAPTION : window_component; -} - -void NormalBrowserFrameView::GetWindowMask(const gfx::Size& size, - gfx::Path* window_mask) { - DCHECK(window_mask); - // Always maximized. -} - -void NormalBrowserFrameView::EnableClose(bool enable) { - // No close button -} - -void NormalBrowserFrameView::ResetWindowControls() { -} - -/////////////////////////////////////////////////////////////////////////////// -// NormalBrowserFrameView, views::View overrides: - -void NormalBrowserFrameView::Paint(gfx::Canvas* canvas) { - views::Window* window = frame_->GetWindow(); - if (window->IsFullscreen()) - return; // Nothing is visible, so don't bother to paint. - - PaintMaximizedFrameBorder(canvas); - PaintToolbarBackground(canvas); -} - -void NormalBrowserFrameView::Layout() { - int top_height = NonClientTopBorderHeight(); - int border_thickness = FrameBorderThickness(); - client_view_bounds_ = gfx::Rect(border_thickness, top_height, - std::max(0, width() - (2 * border_thickness)), - std::max(0, height() - top_height - border_thickness)); -} - -bool NormalBrowserFrameView::HitTest(const gfx::Point& l) const { - // If the point is outside the bounds of the client area, claim it. - if (NonClientFrameView::HitTest(l)) - return true; - - // Otherwise claim it only if it's in a non-tab portion of the tabstrip. - bool vertical_tabs = browser_view_->UseVerticalTabs(); - const gfx::Rect& tabstrip_bounds = browser_view_->tabstrip()->bounds(); - if ((!vertical_tabs && l.y() > tabstrip_bounds.bottom()) || - (vertical_tabs && (l.x() > tabstrip_bounds.right() || - l.y() > tabstrip_bounds.bottom()))) { - return false; - } - - // We convert from our parent's coordinates since we assume we fill its bounds - // completely. We need to do this since we're not a parent of the tabstrip, - // meaning ConvertPointToView would otherwise return something bogus. - gfx::Point browser_view_point(l); - View::ConvertPointToView(GetParent(), browser_view_, &browser_view_point); - return browser_view_->IsPositionInWindowCaption(browser_view_point); -} - -void NormalBrowserFrameView::ViewHierarchyChanged(bool is_add, - views::View* parent, - views::View* child) { - if (is_add && child == this) { - // The Accessibility glue looks for the product name on these two views to - // determine if this is in fact a Chrome window. - GetRootView()->SetAccessibleName(l10n_util::GetString(IDS_PRODUCT_NAME)); - } -} - -bool NormalBrowserFrameView::GetAccessibleRole(AccessibilityTypes::Role* role) { - DCHECK(role); - - *role = AccessibilityTypes::ROLE_TITLEBAR; - return true; -} - -/////////////////////////////////////////////////////////////////////////////// -// NormalBrowserFrameView, TabIconView::TabContentsProvider implementation: - -bool NormalBrowserFrameView::ShouldTabIconViewAnimate() const { - // This function is queried during the creation of the window as the - // TabIconView we host is initialized, so we need to NULL check the selected - // TabContents because in this condition there is not yet a selected tab. - TabContents* current_tab = browser_view_->GetSelectedTabContents(); - return current_tab ? current_tab->is_loading() : false; -} - -SkBitmap NormalBrowserFrameView::GetFavIconForTabIconView() { - return frame_->GetWindow()->GetDelegate()->GetWindowIcon(); -} - -/////////////////////////////////////////////////////////////////////////////// -// NormalBrowserFrameView, private: - -int NormalBrowserFrameView::FrameBorderThickness() const { - static int border_thickness_ = - CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeosFrame) ? - kFrameBorderThicknessForDev : 0; - return border_thickness_; -} - -int NormalBrowserFrameView::NonClientTopBorderHeight() const { - return std::max(0, FrameBorderThickness() - - (browser_view_->IsTabStripVisible() ? kTabstripTopShadowThickness : 0)); -} - -void NormalBrowserFrameView::PaintMaximizedFrameBorder(gfx::Canvas* canvas) { - ThemeProvider* tp = GetThemeProvider(); - views::Window* window = frame_->GetWindow(); - - // Window frame mode and color - SkBitmap* theme_frame; - // HACK: This is to properly align the frame background with the tab - // background. This was added because when this code was copied from the - // opaque frame code, that code didn't correctly handle maximized mode theme - // alignment. That bug has since been fixed in a more general but more - // complex way in the opaque frame. Since this file is eventually going to - // die (see crbug.com/52674), I'm just leaving this here rather than replacing - // it with the complex fix. - int y = -kCustomFrameBackgroundVerticalOffset; - // Never theme app and popup windows. - if (!browser_view_->IsBrowserTypeNormal()) { - ResourceBundle& rb = ResourceBundle::GetSharedInstance(); - theme_frame = rb.GetBitmapNamed(ShouldPaintAsActive() ? - IDR_FRAME : IDR_FRAME_INACTIVE); - y = 0; // These are never themed. - } else if (!browser_view_->IsOffTheRecord()) { - theme_frame = tp->GetBitmapNamed(ShouldPaintAsActive() ? - IDR_THEME_FRAME : IDR_THEME_FRAME_INACTIVE); - } else { - theme_frame = tp->GetBitmapNamed(ShouldPaintAsActive() ? - IDR_THEME_FRAME_INCOGNITO: IDR_THEME_FRAME_INCOGNITO_INACTIVE); - } - // Draw the theme frame. It must be aligned with the tabstrip as if we were - // in restored mode. Note that the top of the tabstrip is - // kTabstripTopShadowThickness px off the top of the screen. - canvas->TileImageInt(*theme_frame, 0, y, width(), theme_frame->height()); - - // Draw the theme frame overlay - if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY) && - browser_view_->IsBrowserTypeNormal()) { - SkBitmap* theme_overlay = tp->GetBitmapNamed(ShouldPaintAsActive() ? - IDR_THEME_FRAME_OVERLAY : IDR_THEME_FRAME_OVERLAY_INACTIVE); - canvas->DrawBitmapInt(*theme_overlay, 0, y); - } - - if (!browser_view_->IsToolbarVisible()) { - // There's no toolbar to edge the frame border, so we need to draw a bottom - // edge. The graphic we use for this has a built in client edge, so we clip - // it off the bottom. - SkBitmap* top_center = - tp->GetBitmapNamed(IDR_APP_TOP_CENTER); - int edge_height = top_center->height() - kClientEdgeThickness; - canvas->TileImageInt(*top_center, 0, - window->GetClientView()->y() - edge_height, width(), edge_height); - } -} - -void NormalBrowserFrameView::PaintToolbarBackground(gfx::Canvas* canvas) { - if (!browser_view_->IsToolbarVisible()) - return; - - gfx::Rect toolbar_bounds(browser_view_->GetToolbarBounds()); - if (toolbar_bounds.IsEmpty()) - return; - - ThemeProvider* tp = GetThemeProvider(); - gfx::Point toolbar_origin(toolbar_bounds.origin()); - View::ConvertPointToView(frame_->GetWindow()->GetClientView(), - this, &toolbar_origin); - toolbar_bounds.set_origin(toolbar_origin); - - // Gross hack: We split the toolbar images into two pieces, since sometimes - // (popup mode) the toolbar isn't tall enough to show the whole image. The - // split happens between the top shadow section and the bottom gradient - // section so that we never break the gradient. - int split_point = kFrameShadowThickness * 2; - int bottom_y = toolbar_bounds.y() + split_point; - SkBitmap* toolbar_left = - tp->GetBitmapNamed(IDR_CONTENT_TOP_LEFT_CORNER); - int bottom_edge_height = - std::min(toolbar_left->height(), toolbar_bounds.height()) - split_point; - - SkColor theme_toolbar_color = - tp->GetColor(BrowserThemeProvider::COLOR_TOOLBAR); - canvas->FillRectInt(theme_toolbar_color, toolbar_bounds.x(), bottom_y, - toolbar_bounds.width(), bottom_edge_height); - - int strip_height = browser_view_->GetTabStripHeight(); - SkBitmap* theme_toolbar = tp->GetBitmapNamed(IDR_THEME_TOOLBAR); - - canvas->TileImageInt(*theme_toolbar, toolbar_bounds.x(), - strip_height - kFrameShadowThickness, toolbar_bounds.x(), bottom_y, - toolbar_bounds.width(), theme_toolbar->height()); - - canvas->DrawBitmapInt(*toolbar_left, 0, 0, toolbar_left->width(), split_point, - toolbar_bounds.x() - toolbar_left->width(), toolbar_bounds.y(), - toolbar_left->width(), split_point, false); - canvas->DrawBitmapInt(*toolbar_left, 0, - toolbar_left->height() - bottom_edge_height, toolbar_left->width(), - bottom_edge_height, toolbar_bounds.x() - toolbar_left->width(), bottom_y, - toolbar_left->width(), bottom_edge_height, false); - - SkBitmap* toolbar_center = - tp->GetBitmapNamed(IDR_CONTENT_TOP_CENTER); - canvas->TileImageInt(*toolbar_center, 0, 0, toolbar_bounds.x(), - toolbar_bounds.y(), toolbar_bounds.width(), split_point); - - SkBitmap* toolbar_right = tp->GetBitmapNamed(IDR_CONTENT_TOP_RIGHT_CORNER); - canvas->DrawBitmapInt(*toolbar_right, 0, 0, toolbar_right->width(), - split_point, toolbar_bounds.right(), toolbar_bounds.y(), - toolbar_right->width(), split_point, false); - canvas->DrawBitmapInt(*toolbar_right, 0, - toolbar_right->height() - bottom_edge_height, toolbar_right->width(), - bottom_edge_height, toolbar_bounds.right(), bottom_y, - toolbar_right->width(), bottom_edge_height, false); - - // Draw the content/toolbar separator. - canvas->FillRectInt(ResourceBundle::toolbar_separator_color, - toolbar_bounds.x(), toolbar_bounds.bottom() - kClientEdgeThickness, - toolbar_bounds.width(), kClientEdgeThickness); -} - -} // namespace chromeos diff --git a/chrome/browser/chromeos/frame/normal_browser_frame_view.h b/chrome/browser/chromeos/frame/normal_browser_frame_view.h deleted file mode 100644 index cc73a39..0000000 --- a/chrome/browser/chromeos/frame/normal_browser_frame_view.h +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_CHROMEOS_FRAME_NORMAL_BROWSER_FRAME_VIEW_H_ -#define CHROME_BROWSER_CHROMEOS_FRAME_NORMAL_BROWSER_FRAME_VIEW_H_ -#pragma once - -#include "chrome/browser/views/frame/browser_frame.h" -#include "chrome/browser/views/frame/browser_non_client_frame_view.h" -#include "chrome/browser/views/tab_icon_view.h" -#include "views/controls/button/button.h" -#include "views/window/non_client_view.h" - -class BaseTabStrip; -class BrowserView; -namespace gfx { -class Font; -} -class TabContents; -namespace views { -class ImageButton; -class ImageView; -} - -namespace chromeos { - -class NormalBrowserFrameView : public BrowserNonClientFrameView, - public TabIconView::TabIconViewModel { - public: - // Constructs a non-client view for an BrowserFrame. - NormalBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view); - virtual ~NormalBrowserFrameView(); - - // Overridden from BrowserNonClientFrameView: - virtual gfx::Rect GetBoundsForTabStrip(BaseTabStrip* tabstrip) const; - virtual int GetHorizontalTabStripVerticalOffset(bool restored) const; - virtual void UpdateThrobber(bool running); - virtual gfx::Size GetMinimumSize(); - - protected: - // Overridden from views::NonClientFrameView: - virtual gfx::Rect GetBoundsForClientView() const; - virtual bool AlwaysUseNativeFrame() const; - virtual gfx::Rect GetWindowBoundsForClientBounds( - const gfx::Rect& client_bounds) const; - virtual int NonClientHitTest(const gfx::Point& point); - virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); - virtual void EnableClose(bool enable); - virtual void ResetWindowControls(); - - // Overridden from views::View: - virtual void Paint(gfx::Canvas* canvas); - virtual void Layout(); - virtual bool HitTest(const gfx::Point& l) const; - virtual void ViewHierarchyChanged(bool is_add, - views::View* parent, - views::View* child); - virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); - - // Overridden from TabIconView::TabIconViewModel: - virtual bool ShouldTabIconViewAnimate() const; - virtual SkBitmap GetFavIconForTabIconView(); - - private: - // Returns the thickness of the border that makes up the window frame edges. - // This does not include any client edge. - int FrameBorderThickness() const; - - // Returns the height of the entire nonclient top border, including the window - // frame, any title area, and any connected client edge. - int NonClientTopBorderHeight() const; - - // Paint various sub-components of this view. The *FrameBorder() functions - // also paint the background of the titlebar area, since the top frame border - // and titlebar background are a contiguous component. - void PaintMaximizedFrameBorder(gfx::Canvas* canvas); - void PaintToolbarBackground(gfx::Canvas* canvas); - - // The frame that hosts this view. - BrowserFrame* frame_; - - // The BrowserView hosted within this View. - BrowserView* browser_view_; - - // The bounds of the ClientView. - gfx::Rect client_view_bounds_; - - DISALLOW_COPY_AND_ASSIGN(NormalBrowserFrameView); -}; - -} // namespace chromeos - -#endif // CHROME_BROWSER_CHROMEOS_FRAME_NORMAL_BROWSER_FRAME_VIEW_H_ diff --git a/chrome/browser/chromeos/view_ids.h b/chrome/browser/chromeos/view_ids.h index e104612..f8b2794 100644 --- a/chrome/browser/chromeos/view_ids.h +++ b/chrome/browser/chromeos/view_ids.h @@ -13,7 +13,6 @@ enum ChromeOSViewIds { // Start with the offset that is big enough to avoid possible // collison. VIEW_ID_STATUS_AREA = VIEW_ID_PREDEFINED_COUNT + 10000, - VIEW_ID_OTR_AVATAR, }; #endif // CHROME_BROWSER_CHROMEOS_VIEW_IDS_H_ diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index cc8af50..c851581 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -457,8 +457,6 @@ 'browser/chromeos/frame/browser_frame_chromeos.h', 'browser/chromeos/frame/browser_view.cc', 'browser/chromeos/frame/browser_view.h', - 'browser/chromeos/frame/normal_browser_frame_view.cc', - 'browser/chromeos/frame/normal_browser_frame_view.h', 'browser/chromeos/frame/panel_browser_view.cc', 'browser/chromeos/frame/panel_browser_view.h', 'browser/chromeos/frame/panel_controller.cc', |