Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / views / frame / browser_view.cc
index 03cc0fd..150d202 100644 (file)
@@ -37,8 +37,6 @@
 #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"
@@ -77,6 +75,7 @@
 #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"
@@ -239,14 +240,14 @@ class BrowserViewLayoutDelegateImpl : public BrowserViewLayoutDelegate {
  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.
@@ -254,11 +255,11 @@ class BrowserViewLayoutDelegateImpl : public BrowserViewLayoutDelegate {
            (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_,
@@ -266,26 +267,26 @@ class BrowserViewLayoutDelegateImpl : public BrowserViewLayoutDelegate {
     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();
   }
 
@@ -306,7 +307,7 @@ class BookmarkExtensionBackground : public views::Background {
                               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_;
@@ -399,9 +400,6 @@ BrowserView::BrowserView()
       ticker_(0),
 #endif
       force_location_bar_focus_(false),
-#if defined(OS_CHROMEOS)
-      scroll_end_effect_controller_(ScrollEndEffectController::Create()),
-#endif
       activate_modal_dialog_factory_(this) {
 }
 
@@ -679,7 +677,7 @@ void BrowserView::SetAlwaysOnTop(bool always_on_top) {
   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.
@@ -824,6 +822,9 @@ void BrowserView::OnActiveTabChanged(content::WebContents* old_contents,
 
   // Update all the UI bits.
   UpdateTitleBar();
+
+  TranslateBubbleView::CloseBubble();
+  ZoomBubbleView::CloseBubble();
 }
 
 void BrowserView::ZoomChangedForActiveTab(bool can_show_bubble) {
@@ -2434,13 +2435,8 @@ void BrowserView::ShowAvatarBubbleFromAvatarButton(
                                       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() {