#include "chrome/browser/themes/theme_properties.h"
#include "chrome/browser/themes/theme_service_factory.h"
#include "chrome/browser/translate/chrome_translate_client.h"
-#include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h"
-#include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h"
#include "chrome/browser/ui/bookmarks/bookmark_bar_constants.h"
#include "chrome/browser/ui/bookmarks/bookmark_bubble_delegate.h"
#include "chrome/browser/ui/bookmarks/bookmark_bubble_sign_in_delegate.h"
#include "chrome/browser/ui/views/infobars/infobar_container_view.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/browser/ui/views/location_bar/location_icon_view.h"
+#include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h"
#include "chrome/browser/ui/views/omnibox/omnibox_view_views.h"
#include "chrome/browser/ui/views/profiles/avatar_menu_bubble_view.h"
#include "chrome/browser/ui/views/profiles/avatar_menu_button.h"
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/grit/locale_settings.h"
+#include "components/app_modal_dialogs/app_modal_dialog.h"
+#include "components/app_modal_dialogs/app_modal_dialog_queue.h"
#include "components/signin/core/common/profile_management_switches.h"
#include "components/translate/core/browser/language_state.h"
#include "content/app/resources/grit/content_resources.h"
public:
explicit BrowserViewLayoutDelegateImpl(BrowserView* browser_view)
: browser_view_(browser_view) {}
- virtual ~BrowserViewLayoutDelegateImpl() {}
+ ~BrowserViewLayoutDelegateImpl() override {}
// BrowserViewLayoutDelegate overrides:
- virtual views::View* GetContentsWebView() const OVERRIDE {
+ views::View* GetContentsWebView() const override {
return browser_view_->contents_web_view_;
}
- virtual bool DownloadShelfNeedsLayout() const OVERRIDE {
+ bool DownloadShelfNeedsLayout() const override {
DownloadShelfView* download_shelf = browser_view_->download_shelf_.get();
// Re-layout the shelf either if it is visible or if its close animation
// is currently running.
(download_shelf->IsShowing() || download_shelf->IsClosing());
}
- virtual bool IsTabStripVisible() const OVERRIDE {
+ bool IsTabStripVisible() const override {
return browser_view_->IsTabStripVisible();
}
- virtual gfx::Rect GetBoundsForTabStripInBrowserView() const OVERRIDE {
+ gfx::Rect GetBoundsForTabStripInBrowserView() const override {
gfx::RectF bounds_f(browser_view_->frame()->GetBoundsForTabStrip(
browser_view_->tabstrip()));
views::View::ConvertRectToTarget(browser_view_->parent(), browser_view_,
return gfx::ToEnclosingRect(bounds_f);
}
- virtual int GetTopInsetInBrowserView() const OVERRIDE {
+ int GetTopInsetInBrowserView() const override {
return browser_view_->frame()->GetTopInset() -
browser_view_->y();
}
- virtual int GetThemeBackgroundXInset() const OVERRIDE {
+ int GetThemeBackgroundXInset() const override {
// TODO(pkotwicz): Return the inset with respect to the left edge of the
// BrowserView.
return browser_view_->frame()->GetThemeBackgroundXInset();
}
- virtual bool IsToolbarVisible() const OVERRIDE {
+ bool IsToolbarVisible() const override {
return browser_view_->IsToolbarVisible();
}
- virtual bool IsBookmarkBarVisible() const OVERRIDE {
+ bool IsBookmarkBarVisible() const override {
return browser_view_->IsBookmarkBarVisible();
}
- virtual FullscreenExitBubbleViews* GetFullscreenExitBubble() const OVERRIDE {
+ FullscreenExitBubbleViews* GetFullscreenExitBubble() const override {
return browser_view_->fullscreen_exit_bubble();
}
Browser* browser);
// View methods overridden from views:Background.
- virtual void Paint(gfx::Canvas* canvas, views::View* view) const OVERRIDE;
+ void Paint(gfx::Canvas* canvas, views::View* view) const override;
private:
BrowserView* browser_view_;
ticker_(0),
#endif
force_location_bar_focus_(false),
-#if defined(OS_CHROMEOS)
- scroll_end_effect_controller_(ScrollEndEffectController::Create()),
-#endif
activate_modal_dialog_factory_(this) {
}
NOTIMPLEMENTED();
}
-gfx::NativeWindow BrowserView::GetNativeWindow() {
+gfx::NativeWindow BrowserView::GetNativeWindow() const {
// While the browser destruction is going on, the widget can already be gone,
// but utility functions like FindBrowserWithWindow will come here and crash.
// We short circuit therefore.
// Update all the UI bits.
UpdateTitleBar();
+
+ TranslateBubbleView::CloseBubble();
+ ZoomBubbleView::CloseBubble();
}
void BrowserView::ZoomChangedForActiveTab(bool can_show_bubble) {
views::BubbleBorder::PAINT_NORMAL;
AvatarMenuBubbleView::ShowBubble(anchor_view, arrow, arrow_paint_type,
alignment, bounds, browser());
- ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE);
}
-}
-
-void BrowserView::OverscrollUpdate(int delta_y) {
- if (scroll_end_effect_controller_)
- scroll_end_effect_controller_->OverscrollUpdate(delta_y);
+ ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE);
}
int BrowserView::GetRenderViewHeightInsetWithDetachedBookmarkBar() {