summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authormad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-09 20:10:17 +0000
committermad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-09 20:10:17 +0000
commitc3826037cbcb22fe784a10589061eaf084818727 (patch)
tree58da3c893c97e0fd5fee5df93f3dc30db7b93a40 /chrome/browser
parentb595ba77947ee0881ae8ce16ee92b47d1c48f10a (diff)
downloadchromium_src-c3826037cbcb22fe784a10589061eaf084818727.zip
chromium_src-c3826037cbcb22fe784a10589061eaf084818727.tar.gz
chromium_src-c3826037cbcb22fe784a10589061eaf084818727.tar.bz2
Add a new resizer corner.
To display a resize bitmap and handle the mouse interactions as requested in http://code.google.com/p/chromium/issues/detail?id=458. BUG=458 There are unfortunately two cases to handle and they must be handled separately. The first one is when there are no bottom shelf like the download bar, and the case where there is one. For the case without, we must draw on top of what we receive from WebKit, so we intercept the bitmap in RenderWidgetHostViewWin::OnPaint() so that we can draw the resize corner bitmap on top of it (taking into account whether we are in a right to left language or not). For the case where we have a bottom shelf, we use a dedicated view that we properly layout on top of the bottom shelf view (which takes care of handling the RTL language case for us). Same split for the mouse interactions. Without the bottom shelf, we must deal with it in RenderWidgetHostViewWin::OnMouseEvent() by sending the root window a WM_NCLBUTTONDOWN message with either HTBOTTOMRIGHT or HTBOTTOMLEFT (based on the RTL setting) and let the OS take care of the resizing. IF we have a bottom shelf, we must deal with the mouse interaction in BrowserView::NonClientHitTest() to either return HTBOTTOMRIGHT or HTBOTTOMLEFT (again, based on the RTL setting) and, again, let the OS take care of the resizing. More details here: http://code.google.com/p/chromium/wiki/BrowserViewResizer git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9408 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/browser.cc8
-rw-r--r--chrome/browser/browser.h5
-rw-r--r--chrome/browser/browser_window.h10
-rw-r--r--chrome/browser/browser_window_cocoa.h3
-rw-r--r--chrome/browser/browser_window_cocoa.mm6
-rw-r--r--chrome/browser/browser_window_gtk.cc5
-rw-r--r--chrome/browser/browser_window_gtk.h3
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc21
-rw-r--r--chrome/browser/renderer_host/render_view_host.h1
-rw-r--r--chrome/browser/renderer_host/render_view_host_delegate.h15
-rw-r--r--chrome/browser/renderer_host/render_widget_host.cc7
-rw-r--r--chrome/browser/renderer_host/render_widget_host.h4
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_win.cc89
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_win.h4
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.cc8
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.h1
-rw-r--r--chrome/browser/tab_contents/tab_contents.h4
-rw-r--r--chrome/browser/tab_contents/tab_contents_delegate.h23
-rw-r--r--chrome/browser/tab_contents/web_contents.cc33
-rw-r--r--chrome/browser/tab_contents/web_contents.h7
-rw-r--r--chrome/browser/views/download_shelf_view.cc8
-rw-r--r--chrome/browser/views/download_shelf_view.h10
-rw-r--r--chrome/browser/views/frame/browser_view.cc115
-rw-r--r--chrome/browser/views/frame/browser_view.h5
24 files changed, 306 insertions, 89 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index e9c48f1..8b6af85 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -1089,7 +1089,7 @@ void Browser::ExecuteCommand(int id) {
case IDC_NEW_WINDOW_PROFILE_5:
case IDC_NEW_WINDOW_PROFILE_6:
case IDC_NEW_WINDOW_PROFILE_7:
- case IDC_NEW_WINDOW_PROFILE_8:
+ case IDC_NEW_WINDOW_PROFILE_8:
NewProfileWindowByIndex(id - IDC_NEW_WINDOW_PROFILE_0); break;
#if defined(OS_WIN)
case IDC_CLOSE_WINDOW: CloseWindow(); break;
@@ -1372,7 +1372,7 @@ bool Browser::RunUnloadListenerBeforeClosing(TabContents* contents) {
if (web_contents) {
// If the WebContents is not connected yet, then there's no unload
// handler we can fire even if the WebContents has an unload listener.
- // One case where we hit this is in a tab that has an infinite loop
+ // One case where we hit this is in a tab that has an infinite loop
// before load.
if (TabHasUnloadListener(contents)) {
// If the page has unload listeners, then we tell the renderer to fire
@@ -1874,6 +1874,10 @@ void Browser::BeforeUnloadFired(TabContents* tab,
*proceed_to_fire_unload = true;
}
+gfx::Rect Browser::GetRootWindowResizerRect() const {
+ return window_->GetRootWindowResizerRect();
+}
+
void Browser::ShowHtmlDialog(HtmlDialogContentsDelegate* delegate,
void* parent_window) {
window_->ShowHTMLDialog(delegate, parent_window);
diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h
index 1874426..0fc72a0 100644
--- a/chrome/browser/browser.h
+++ b/chrome/browser/browser.h
@@ -391,8 +391,9 @@ class Browser : public TabStripModelDelegate,
virtual void ContentsStateChanged(TabContents* source);
virtual bool ShouldDisplayURLField();
virtual void BeforeUnloadFired(TabContents* source,
- bool proceed,
+ bool proceed,
bool* proceed_to_fire_unload);
+ virtual gfx::Rect GetRootWindowResizerRect() const;
virtual void ShowHtmlDialog(HtmlDialogContentsDelegate* delegate,
void* parent_window);
virtual void SetFocusToLocationBar();
@@ -490,7 +491,7 @@ class Browser : public TabStripModelDelegate,
bool RemoveFromSet(UnloadListenerSet* set, TabContents* tab);
// Cleans up state appropriately when we are trying to close the browser and
- // the tab has finished firing it's unload handler. We also use this in the
+ // the tab has finished firing it's unload handler. We also use this in the
// cases where a tab crashes or hangs even if the beforeunload/unload haven't
// successfully fired.
void ClearUnloadState(TabContents* tab);
diff --git a/chrome/browser/browser_window.h b/chrome/browser/browser_window.h
index 1b382ae..2809d2e 100644
--- a/chrome/browser/browser_window.h
+++ b/chrome/browser/browser_window.h
@@ -83,7 +83,7 @@ class BrowserWindow {
// TODO(beng): REMOVE?
// Returns true if the frame is maximized (aka zoomed).
- virtual bool IsMaximized() = 0;
+ virtual bool IsMaximized() const = 0;
// Returns the location bar.
virtual LocationBar* GetLocationBar() const = 0;
@@ -102,6 +102,12 @@ class BrowserWindow {
// Returns whether the bookmark bar is visible or not.
virtual bool IsBookmarkBarVisible() const = 0;
+ // Returns the rect where the resize corner should be drawn by the render
+ // widget host view (on top of what the renderer returns). We return an empty
+ // rect to identify that there shouldn't be a resize corner (in the cases
+ // where we take care of it ourselves at the browser level).
+ virtual gfx::Rect GetRootWindowResizerRect() const = 0;
+
// Shows or hides the bookmark bar depending on its current visibility.
virtual void ToggleBookmarkBar() = 0;
@@ -126,7 +132,7 @@ class BrowserWindow {
// Shows the Import Bookmarks & Settings dialog box.
virtual void ShowImportDialog() = 0;
-
+
// Shows the Search Engines dialog box.
virtual void ShowSearchEnginesDialog() = 0;
diff --git a/chrome/browser/browser_window_cocoa.h b/chrome/browser/browser_window_cocoa.h
index fa7e707..e719aa1 100644
--- a/chrome/browser/browser_window_cocoa.h
+++ b/chrome/browser/browser_window_cocoa.h
@@ -34,13 +34,14 @@ class BrowserWindowCocoa : public BrowserWindow {
virtual void UpdateLoadingAnimations(bool should_animate);
virtual void SetStarredState(bool is_starred);
virtual gfx::Rect GetNormalBounds() const;
- virtual bool IsMaximized();
+ virtual bool IsMaximized() const;
virtual LocationBar* GetLocationBar() const;
virtual void UpdateStopGoState(bool is_loading);
virtual void UpdateToolbar(TabContents* contents,
bool should_restore_state);
virtual void FocusToolbar();
virtual bool IsBookmarkBarVisible() const;
+ virtual gfx::Rect GetRootWindowResizerRect() const;
virtual void ToggleBookmarkBar();
virtual void ShowAboutChromeDialog();
virtual void ShowBookmarkManager();
diff --git a/chrome/browser/browser_window_cocoa.mm b/chrome/browser/browser_window_cocoa.mm
index c541985..7f313729 100644
--- a/chrome/browser/browser_window_cocoa.mm
+++ b/chrome/browser/browser_window_cocoa.mm
@@ -83,10 +83,14 @@ gfx::Rect BrowserWindowCocoa::GetNormalBounds() const {
return bounds;
}
-bool BrowserWindowCocoa::IsMaximized() {
+bool BrowserWindowCocoa::IsMaximized() const {
return [window_ isZoomed];
}
+gfx::Rect BrowserWindowCocoa::GetRootWindowResizerRect() const {
+ return gfx::Rect();
+}
+
LocationBar* BrowserWindowCocoa::GetLocationBar() const {
return [controller_ locationBar];
}
diff --git a/chrome/browser/browser_window_gtk.cc b/chrome/browser/browser_window_gtk.cc
index 87fd231..6df463e 100644
--- a/chrome/browser/browser_window_gtk.cc
+++ b/chrome/browser/browser_window_gtk.cc
@@ -123,6 +123,11 @@ bool BrowserWindowGtk::IsBookmarkBarVisible() const {
return false;
}
+gfx::Rect BrowserWindow::GetRootWindowResizerRect() const {
+ NOTIMPLEMENTED();
+ return false;
+}
+
void BrowserWindowGtk::ToggleBookmarkBar() {
NOTIMPLEMENTED();
}
diff --git a/chrome/browser/browser_window_gtk.h b/chrome/browser/browser_window_gtk.h
index 07e9e2f..b7c4eea 100644
--- a/chrome/browser/browser_window_gtk.h
+++ b/chrome/browser/browser_window_gtk.h
@@ -34,13 +34,14 @@ class BrowserWindowGtk : public BrowserWindow {
virtual void UpdateLoadingAnimations(bool should_animate);
virtual void SetStarredState(bool is_starred);
virtual gfx::Rect GetNormalBounds() const;
- virtual bool IsMaximized();
+ virtual bool IsMaximized() const;
virtual LocationBar* GetLocationBar() const;
virtual void UpdateStopGoState(bool is_loading);
virtual void UpdateToolbar(TabContents* contents,
bool should_restore_state);
virtual void FocusToolbar();
virtual bool IsBookmarkBarVisible() const;
+ virtual gfx::Rect GetRootWindowResizerRect() const;
virtual void ToggleBookmarkBar();
virtual void ShowAboutChromeDialog();
virtual void ShowBookmarkManager();
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index e244c83..cf9be2d 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -150,7 +150,8 @@ bool RenderViewHost::CreateRenderView() {
SYNCHRONIZE,
FALSE,
0);
- DCHECK(result) << "Couldn't duplicate the modal dialog handle for the renderer.";
+ DCHECK(result) <<
+ "Couldn't duplicate the modal dialog handle for the renderer.";
#endif
DCHECK(view());
@@ -308,7 +309,7 @@ void RenderViewHost::ClosePage(int new_render_process_host_id,
}
}
-void RenderViewHost::SetHasPendingCrossSiteRequest(bool has_pending_request,
+void RenderViewHost::SetHasPendingCrossSiteRequest(bool has_pending_request,
int request_id) {
Singleton<CrossSiteRequestManager>()->SetHasPendingCrossSiteRequest(
process()->host_id(), routing_id(), has_pending_request);
@@ -382,7 +383,8 @@ void RenderViewHost::DragTargetDragEnter(const WebDropData& drop_data,
// Grant the renderer the ability to load the drop_data.
RendererSecurityPolicy* policy = RendererSecurityPolicy::GetInstance();
policy->GrantRequestURL(process()->host_id(), drop_data.url);
- for (std::vector<std::wstring>::const_iterator iter(drop_data.filenames.begin());
+ for (std::vector<std::wstring>::const_iterator
+ iter(drop_data.filenames.begin());
iter != drop_data.filenames.end(); ++iter) {
policy->GrantRequestURL(process()->host_id(),
net::FilePathToFileURL(*iter));
@@ -515,7 +517,8 @@ void RenderViewHost::JavaScriptMessageBoxClosed(IPC::Message* reply_msg,
if (--modal_dialog_count_ == 0)
modal_dialog_event_->Reset();
- ViewHostMsg_RunJavaScriptMessage::WriteReplyParams(reply_msg, success, prompt);
+ ViewHostMsg_RunJavaScriptMessage::WriteReplyParams(reply_msg,
+ success, prompt);
Send(reply_msg);
}
@@ -572,7 +575,8 @@ void RenderViewHost::AllowDomAutomationBindings() {
void RenderViewHost::AllowDOMUIBindings() {
DCHECK(!renderer_initialized_);
enable_dom_ui_bindings_ = true;
- RendererSecurityPolicy::GetInstance()->GrantDOMUIBindings(process()->host_id());
+ RendererSecurityPolicy::GetInstance()->GrantDOMUIBindings(
+ process()->host_id());
}
void RenderViewHost::AllowExternalHostBindings() {
@@ -936,7 +940,8 @@ void RenderViewHost::OnMsgDidStartProvisionalLoadForFrame(bool is_main_frame,
FilterURL(RendererSecurityPolicy::GetInstance(),
process()->host_id(), &validated_url);
- delegate_->DidStartProvisionalLoadForFrame(this, is_main_frame, validated_url);
+ delegate_->DidStartProvisionalLoadForFrame(this, is_main_frame,
+ validated_url);
}
void RenderViewHost::OnMsgDidFailProvisionalLoadWithError(
@@ -1273,6 +1278,10 @@ void RenderViewHost::NotifyRendererResponsive() {
delegate_->RendererResponsive(this);
}
+gfx::Rect RenderViewHost::GetRootWindowResizerRect() const {
+ return delegate_->GetRootWindowResizerRect();
+}
+
void RenderViewHost::OnDebugDisconnect() {
if (debugger_attached_) {
debugger_attached_ = false;
diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h
index 2cd9d29..9d0bb37 100644
--- a/chrome/browser/renderer_host/render_view_host.h
+++ b/chrome/browser/renderer_host/render_view_host.h
@@ -410,6 +410,7 @@ class RenderViewHost : public RenderWidgetHost {
virtual bool IsRenderView() { return true; }
virtual void OnMessageReceived(const IPC::Message& msg);
virtual bool CanBlur() const;
+ virtual gfx::Rect GetRootWindowResizerRect() const;
protected:
// RenderWidgetHost protected overrides.
diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h
index f048dc2..b701b21 100644
--- a/chrome/browser/renderer_host/render_view_host_delegate.h
+++ b/chrome/browser/renderer_host/render_view_host_delegate.h
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/file_path.h"
+#include "base/gfx/rect.h"
#include "base/logging.h"
#include "net/base/load_states.h"
#include "webkit/glue/password_form.h"
@@ -38,10 +39,6 @@ namespace IPC {
class Message;
}
-namespace gfx {
-class Rect;
-}
-
namespace webkit_glue {
struct WebApplicationInfo;
}
@@ -301,13 +298,13 @@ class RenderViewHostDelegate {
// Forms fillable by autofill have been detected in the page.
virtual void AutofillFormSubmitted(const AutofillForm& form) { }
- // Called to retrieve a list of suggestions from the web database given
+ // Called to retrieve a list of suggestions from the web database given
// the name of the field |field_name| and what the user has already typed in
// the field |user_text|. Appeals to the database thead to perform the query.
// When the database thread is finished, the autofill manager retrieves the
// calling RenderViewHost and then passes the vector of suggestions to
// RenderViewHost::AutofillSuggestionsReturned.
- virtual void GetAutofillSuggestions(const std::wstring& field_name,
+ virtual void GetAutofillSuggestions(const std::wstring& field_name,
const std::wstring& user_text,
int64 node_id,
int request_id) { }
@@ -372,9 +369,13 @@ class RenderViewHostDelegate {
// blurred.
virtual bool CanBlur() const { return true; }
+ // Return the rect where to display the resize corner, if any, otherwise
+ // an empty rect.
+ virtual gfx::Rect GetRootWindowResizerRect() const { return gfx::Rect(); }
+
// Notification that the renderer has become unresponsive. The
// delegate can use this notification to show a warning to the user.
- virtual void RendererUnresponsive(RenderViewHost* render_view_host,
+ virtual void RendererUnresponsive(RenderViewHost* render_view_host,
bool is_during_unload) { }
// Notification that a previously unresponsive renderer has become
diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc
index a6d289b..e196a00 100644
--- a/chrome/browser/renderer_host/render_widget_host.cc
+++ b/chrome/browser/renderer_host/render_widget_host.cc
@@ -164,7 +164,8 @@ void RenderWidgetHost::WasResized() {
if (!new_size.IsEmpty())
resize_ack_pending_ = true;
- if (!Send(new ViewMsg_Resize(routing_id_, new_size)))
+ if (!Send(new ViewMsg_Resize(routing_id_, new_size,
+ GetRootWindowResizerRect())))
resize_ack_pending_ = false;
}
@@ -330,6 +331,10 @@ void RenderWidgetHost::RendererExited() {
BackingStoreManager::RemoveBackingStore(this);
}
+gfx::Rect RenderWidgetHost::GetRootWindowResizerRect() const {
+ return gfx::Rect();
+}
+
void RenderWidgetHost::Destroy() {
NotificationService::current()->Notify(
NotificationType::RENDER_WIDGET_HOST_DESTROYED,
diff --git a/chrome/browser/renderer_host/render_widget_host.h b/chrome/browser/renderer_host/render_widget_host.h
index 4bd1849..48fc912 100644
--- a/chrome/browser/renderer_host/render_widget_host.h
+++ b/chrome/browser/renderer_host/render_widget_host.h
@@ -205,6 +205,10 @@ class RenderWidgetHost : public IPC::Channel::Listener {
void ForwardKeyboardEvent(const WebKeyboardEvent& key_event);
void ForwardInputEvent(const WebInputEvent& input_event, int event_size);
+ // This is for derived classes to give us access to the resizer rect.
+ // And to also expose it to the RenderWidgetHostView.
+ virtual gfx::Rect GetRootWindowResizerRect() const;
+
protected:
// Called when we receive a notification indicating that the renderer
// process has gone. This will reset our state so that our state will be
diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc
index b499669..65a3921 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_win.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc
@@ -20,12 +20,15 @@
#include "chrome/common/l10n_util.h"
#include "chrome/common/plugin_messages.h"
#include "chrome/common/render_messages.h"
+#include "chrome/common/resource_bundle.h"
#include "chrome/common/win_util.h"
// Included for views::kReflectedMessage - TODO(beng): move this to win_util.h!
#include "chrome/views/widget_win.h"
#include "webkit/glue/plugins/plugin_constants_win.h"
#include "webkit/glue/plugins/webplugin_delegate_impl.h"
#include "webkit/glue/webcursor.h"
+#include "webkit_resources.h"
+
using base::TimeDelta;
using base::TimeTicks;
@@ -243,28 +246,40 @@ void RenderWidgetHostViewWin::UpdateCursor(const WebCursor& cursor) {
}
void RenderWidgetHostViewWin::UpdateCursorIfOverSelf() {
+ static HCURSOR kCursorResizeRight = LoadCursor(NULL, IDC_SIZENWSE);
+ static HCURSOR kCursorResizeLeft = LoadCursor(NULL, IDC_SIZENESW);
static HCURSOR kCursorArrow = LoadCursor(NULL, IDC_ARROW);
static HCURSOR kCursorAppStarting = LoadCursor(NULL, IDC_APPSTARTING);
static HINSTANCE module_handle =
GetModuleHandle(chrome::kBrowserResourcesDll);
- // We cannot pass in NULL as the module handle as this would only work for
- // standard win32 cursors. We can also receive cursor types which are defined
- // as webkit resources. We need to specify the module handle of chrome.dll
- // while loading these cursors.
- HCURSOR display_cursor = current_cursor_.GetCursor(module_handle);
-
- // If a page is in the loading state, we want to show the Arrow+Hourglass
- // cursor only when the current cursor is the ARROW cursor. In all other
- // cases we should continue to display the current cursor.
- if (is_loading_ && display_cursor == kCursorArrow)
- display_cursor = kCursorAppStarting;
-
// If the mouse is over our HWND, then update the cursor state immediately.
CPoint pt;
GetCursorPos(&pt);
- if (WindowFromPoint(pt) == m_hWnd)
- SetCursor(display_cursor);
+ if (WindowFromPoint(pt) == m_hWnd) {
+ BOOL result = ::ScreenToClient(m_hWnd, &pt);
+ DCHECK(result);
+ if (render_widget_host_->GetRootWindowResizerRect().Contains(pt.x, pt.y)) {
+ if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT)
+ SetCursor(kCursorResizeLeft);
+ else
+ SetCursor(kCursorResizeRight);
+ } else {
+ // We cannot pass in NULL as the module handle as this would only work for
+ // standard win32 cursors. We can also receive cursor types which are
+ // defined as webkit resources. We need to specify the module handle of
+ // chrome.dll while loading these cursors.
+ HCURSOR display_cursor = current_cursor_.GetCursor(module_handle);
+
+ // If a page is in the loading state, we want to show the Arrow+Hourglass
+ // cursor only when the current cursor is the ARROW cursor. In all other
+ // cases we should continue to display the current cursor.
+ if (is_loading_ && display_cursor == kCursorArrow)
+ display_cursor = kCursorAppStarting;
+
+ SetCursor(display_cursor);
+ }
+ }
}
void RenderWidgetHostViewWin::SetIsLoading(bool is_loading) {
@@ -322,6 +337,37 @@ void RenderWidgetHostViewWin::Redraw(const gfx::Rect& rect) {
EnumChildWindows(m_hWnd, EnumChildProc, lparam);
}
+void RenderWidgetHostViewWin::DrawResizeCorner(const gfx::Rect& paint_rect,
+ HDC dc) {
+ gfx::Rect resize_corner_rect =
+ render_widget_host_->GetRootWindowResizerRect();
+ if (!paint_rect.Intersect(resize_corner_rect).IsEmpty()) {
+ SkBitmap* bitmap = ResourceBundle::GetSharedInstance().
+ GetBitmapNamed(IDR_TEXTAREA_RESIZER);
+ ChromeCanvas canvas(bitmap->width(), bitmap->height(), false);
+ // TODO(jcampan): This const_cast should not be necessary once the
+ // SKIA API has been changed to return a non-const bitmap.
+ const_cast<SkBitmap&>(canvas.getDevice()->accessBitmap(true)).
+ eraseARGB(0, 0, 0, 0);
+ int x = resize_corner_rect.x() + resize_corner_rect.width() -
+ bitmap->width();
+ bool rtl_dir = (l10n_util::GetTextDirection() ==
+ l10n_util::RIGHT_TO_LEFT);
+ if (rtl_dir) {
+ canvas.TranslateInt(bitmap->width(), 0);
+ canvas.ScaleInt(-1, 1);
+ canvas.save();
+ x = 0;
+ }
+ canvas.DrawBitmapInt(*bitmap, 0, 0);
+ canvas.getTopPlatformDevice().drawToHDC(dc, x,
+ resize_corner_rect.y() + resize_corner_rect.height() -
+ bitmap->height(), NULL);
+ if (rtl_dir)
+ canvas.restore();
+ }
+}
+
void RenderWidgetHostViewWin::DidPaintRect(const gfx::Rect& rect) {
if (is_hidden_)
return;
@@ -434,6 +480,7 @@ void RenderWidgetHostViewWin::OnPaint(HDC dc) {
gfx::Rect paint_rect = bitmap_rect.Intersect(damaged_rect);
if (!paint_rect.IsEmpty()) {
+ DrawResizeCorner(paint_rect, backing_store->hdc());
BitBlt(paint_dc.m_hDC,
paint_rect.x(),
paint_rect.y(),
@@ -722,6 +769,20 @@ LRESULT RenderWidgetHostViewWin::OnMouseEvent(UINT message, WPARAM wparam,
// call). So the WebContents window would have to be specified to the
// RenderViewHostHWND as there is no way to retrieve it from the HWND.
if (!close_on_deactivate_) { // Don't forward if the container is a popup.
+ if (message == WM_LBUTTONDOWN) {
+ // If we get clicked on, where the resize corner is drawn, we delegate the
+ // message to the root window, with the proper HTBOTTOMXXX wparam so that
+ // Windows can take care of the resizing for us.
+ if (render_widget_host_->GetRootWindowResizerRect().
+ Contains(GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam))) {
+ WPARAM wparam = HTBOTTOMRIGHT;
+ if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT)
+ wparam = HTBOTTOMLEFT;
+ HWND root_hwnd = ::GetAncestor(m_hWnd, GA_ROOT);
+ if (SendMessage(root_hwnd, WM_NCLBUTTONDOWN, wparam, lparam) == 0)
+ return 0;
+ }
+ }
switch (message) {
case WM_LBUTTONDOWN:
case WM_MBUTTONDOWN:
diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.h b/chrome/browser/renderer_host/render_widget_host_view_win.h
index ec1547a..167f529 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_win.h
+++ b/chrome/browser/renderer_host/render_widget_host_view_win.h
@@ -213,6 +213,10 @@ class RenderWidgetHostViewWin :
// asynchronously.
void Redraw(const gfx::Rect& invalid_rect);
+ // Draw the resize corner bitmap on top of the given HDC, if it intersects the
+ // given paint rect.
+ void DrawResizeCorner(const gfx::Rect& paint_rect, HDC dc);
+
// The associated Model.
RenderWidgetHost* render_widget_host_;
diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc
index 2db7124..51c4875 100644
--- a/chrome/browser/renderer_host/resource_message_filter.cc
+++ b/chrome/browser/renderer_host/resource_message_filter.cc
@@ -205,8 +205,6 @@ bool ResourceMessageFilter::OnMessageReceived(const IPC::Message& message) {
#if defined(OS_WIN)
IPC_MESSAGE_HANDLER(ViewHostMsg_GetWindowRect, OnGetWindowRect)
IPC_MESSAGE_HANDLER(ViewHostMsg_GetRootWindowRect, OnGetRootWindowRect)
- IPC_MESSAGE_HANDLER(ViewHostMsg_GetRootWindowResizerRect,
- OnGetRootWindowResizerRect)
#endif
IPC_MESSAGE_HANDLER(ViewHostMsg_GetMimeTypeFromExtension,
OnGetMimeTypeFromExtension)
@@ -541,12 +539,6 @@ void ResourceMessageFilter::OnGetRootWindowRect(gfx::NativeViewId window_id,
*rect = window_rect;
}
-void ResourceMessageFilter::OnGetRootWindowResizerRect(gfx::NativeViewId window,
- gfx::Rect* rect) {
- RECT window_rect = {0};
- *rect = window_rect;
-}
-
#endif // OS_WIN
void ResourceMessageFilter::OnGetMimeTypeFromExtension(
diff --git a/chrome/browser/renderer_host/resource_message_filter.h b/chrome/browser/renderer_host/resource_message_filter.h
index c4d75e3..7bb8090 100644
--- a/chrome/browser/renderer_host/resource_message_filter.h
+++ b/chrome/browser/renderer_host/resource_message_filter.h
@@ -150,7 +150,6 @@ class ResourceMessageFilter : public IPC::ChannelProxy::MessageFilter,
#if defined(OS_WIN)
void OnGetWindowRect(gfx::NativeViewId window, gfx::Rect *rect);
void OnGetRootWindowRect(gfx::NativeViewId window, gfx::Rect *rect);
- void OnGetRootWindowResizerRect(gfx::NativeViewId window, gfx::Rect *rect);
#endif
void OnGetMimeTypeFromExtension(const std::wstring& ext,
std::string* mime_type);
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h
index e3cb28d..b23c8d5 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -399,7 +399,7 @@ class TabContents : public PageNavigator,
// Removes the InfoBar for the specified |delegate|.
void RemoveInfoBar(InfoBarDelegate* delegate);
-
+
// Enumeration and access functions.
int infobar_delegate_count() const { return infobar_delegates_.size(); }
InfoBarDelegate* GetInfoBarDelegateAt(int index) {
@@ -407,7 +407,7 @@ class TabContents : public PageNavigator,
}
// Toolbars and such ---------------------------------------------------------
-
+
// Returns whether the bookmark bar should be visible.
virtual bool IsBookmarkBarAlwaysVisible() { return false; }
diff --git a/chrome/browser/tab_contents/tab_contents_delegate.h b/chrome/browser/tab_contents/tab_contents_delegate.h
index 428f98e..05f5e79 100644
--- a/chrome/browser/tab_contents/tab_contents_delegate.h
+++ b/chrome/browser/tab_contents/tab_contents_delegate.h
@@ -6,14 +6,10 @@
#define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_
#include "base/basictypes.h"
+#include "base/gfx/rect.h"
#include "chrome/browser/tab_contents/page_navigator.h"
#include "chrome/common/navigation_types.h"
-namespace gfx {
-class Point;
-class Rect;
-}
-
class TabContents;
class HtmlDialogContentsDelegate;
@@ -30,8 +26,7 @@ class TabContentsDelegate : public PageNavigator {
virtual void OpenURL(const GURL& url, const GURL& referrer,
WindowOpenDisposition disposition,
- PageTransition::Type transition)
- {
+ PageTransition::Type transition) {
OpenURLFromTab(NULL, url, referrer, disposition, transition);
}
@@ -106,7 +101,7 @@ class TabContentsDelegate : public PageNavigator {
// a WebContents with a valid WebApp set.
virtual void ConvertContentsToApplication(TabContents* source) { }
- // Informs the TabContentsDelegate that some of our state has changed
+ // Informs the TabContentsDelegate that some of our state has changed
// for this tab.
virtual void ContentsStateChanged(TabContents* source) {}
@@ -119,6 +114,10 @@ class TabContentsDelegate : public PageNavigator {
// call. ConstrainedWindows shouldn't be able to be blurred.
virtual bool CanBlur() const { return true; }
+ // Return the rect where to display the resize corner, if any, otherwise
+ // an empty rect.
+ virtual gfx::Rect GetRootWindowResizerRect() const { return gfx::Rect(); }
+
// Show a dialog with HTML content. |delegate| contains a pointer to the
// delegate who knows how to display the dialog (which file URL and JSON
// string input to use during initialization). |parent_window| is the window
@@ -129,17 +128,17 @@ class TabContentsDelegate : public PageNavigator {
// Tells us that we've finished firing this tab's beforeunload event.
// The proceed bool tells us whether the user chose to proceed closing the
// tab. Returns true if the tab can continue on firing it's unload event.
- // If we're closing the entire browser, then we'll want to delay firing
+ // If we're closing the entire browser, then we'll want to delay firing
// unload events until all the beforeunload events have fired.
virtual void BeforeUnloadFired(TabContents* tab,
- bool proceed,
- bool* proceed_to_fire_unload) {
+ bool proceed,
+ bool* proceed_to_fire_unload) {
*proceed_to_fire_unload = true;
}
// Send IPC to external host. Default implementation is do nothing.
virtual void ForwardMessageToExternalHost(const std::string& receiver,
- const std::string& message) {};
+ const std::string& message) {}
// If the delegate is hosting tabs externally.
virtual bool IsExternalTabContainer() const { return false; }
diff --git a/chrome/browser/tab_contents/web_contents.cc b/chrome/browser/tab_contents/web_contents.cc
index ec55a6c..44ab59b 100644
--- a/chrome/browser/tab_contents/web_contents.cc
+++ b/chrome/browser/tab_contents/web_contents.cc
@@ -394,7 +394,7 @@ bool WebContents::NavigateToPendingEntry(bool reload) {
}
// Clear any provisional password saves - this stops password infobars
- // showing up on pages the user navigates to while the right page is
+ // showing up on pages the user navigates to while the right page is
// loading.
GetPasswordManager()->ClearProvisionalSave();
@@ -422,7 +422,7 @@ void WebContents::Copy() {
}
void WebContents::Paste() {
- render_view_host()->Paste();
+ render_view_host()->Paste();
}
void WebContents::DisassociateFromPopupCount() {
@@ -603,7 +603,7 @@ bool WebContents::IsActiveEntry(int32 page_id) {
}
void WebContents::SetInitialFocus(bool reverse) {
- render_view_host()->SetInitialFocus(reverse);
+ render_view_host()->SetInitialFocus(reverse);
}
// Notifies the RenderWidgetHost instance about the fact that the page is
@@ -670,20 +670,20 @@ void WebContents::DidNavigate(RenderViewHost* rvh,
// We can't do anything about navigations when we're inactive.
if (!controller() || !is_active())
- return;
+ return;
// Update the site of the SiteInstance if it doesn't have one yet.
if (!GetSiteInstance()->has_site())
GetSiteInstance()->SetSite(params.url);
- // Need to update MIME type here because it's referred to in
+ // Need to update MIME type here because it's referred to in
// UpdateNavigationCommands() called by RendererDidNavigate() to
- // determine whether or not to enable the encoding menu.
- // It's updated only for the main frame. For a subframe,
+ // determine whether or not to enable the encoding menu.
+ // It's updated only for the main frame. For a subframe,
// RenderView::UpdateURL does not set params.contents_mime_type.
// (see http://code.google.com/p/chromium/issues/detail?id=2929 )
- // TODO(jungshik): Add a test for the encoding menu to avoid
- // regressing it again.
+ // TODO(jungshik): Add a test for the encoding menu to avoid
+ // regressing it again.
if (PageTransition::IsMainFrame(params.transition))
contents_mime_type_ = params.contents_mime_type;
@@ -1049,7 +1049,7 @@ void WebContents::AutofillFormSubmitted(
GetAutofillManager()->AutofillFormSubmitted(form);
}
-void WebContents::GetAutofillSuggestions(const std::wstring& field_name,
+void WebContents::GetAutofillSuggestions(const std::wstring& field_name,
const std::wstring& user_text, int64 node_id, int request_id) {
GetAutofillManager()->FetchValuesForName(field_name, user_text,
kMaxAutofillMenuItems, node_id, request_id);
@@ -1278,16 +1278,21 @@ bool WebContents::CanBlur() const {
return delegate() ? delegate()->CanBlur() : true;
}
-void WebContents::RendererUnresponsive(RenderViewHost* rvh,
+gfx::Rect WebContents::GetRootWindowResizerRect() const {
+ if (delegate())
+ return delegate()->GetRootWindowResizerRect();
+ return gfx::Rect();
+}
+
+void WebContents::RendererUnresponsive(RenderViewHost* rvh,
bool is_during_unload) {
if (is_during_unload) {
// Hang occurred while firing the beforeunload/unload handler.
// Pretend the handler fired so tab closing continues as if it had.
rvh->UnloadListenerHasFired();
- if (!render_manager_.ShouldCloseTabOnUnresponsiveRenderer()) {
+ if (!render_manager_.ShouldCloseTabOnUnresponsiveRenderer())
return;
- }
// If the tab hangs in the beforeunload/unload handler there's really
// nothing we can do to recover. Pretend the unload listeners have
@@ -1652,7 +1657,7 @@ bool WebContents::UpdateTitleForEntry(NavigationEntry* entry,
profile()->GetHistoryService(Profile::IMPLICIT_ACCESS);
if (hs)
hs->SetPageTitle(entry->display_url(), final_title);
-
+
// Don't allow the title to be saved again for explicitly set ones.
received_page_title_ = explicit_set;
}
diff --git a/chrome/browser/tab_contents/web_contents.h b/chrome/browser/tab_contents/web_contents.h
index 3326cb1..2f3044b 100644
--- a/chrome/browser/tab_contents/web_contents.h
+++ b/chrome/browser/tab_contents/web_contents.h
@@ -214,7 +214,7 @@ class WebContents : public TabContents,
// Override the encoding and reload the page by sending down
// ViewMsg_SetPageEncoding to the renderer. |UpdateEncoding| is kinda
- // the opposite of this, by which 'browser' is notified of
+ // the opposite of this, by which 'browser' is notified of
// the encoding of the current tab from 'renderer' (determined by
// auto-detect, http header, meta, bom detection, etc).
void override_encoding(const std::wstring& encoding) {
@@ -308,7 +308,7 @@ class WebContents : public TabContents,
IPC::Message* reply_msg);
virtual void PasswordFormsSeen(const std::vector<PasswordForm>& forms);
virtual void AutofillFormSubmitted(const AutofillForm& form);
- virtual void GetAutofillSuggestions(const std::wstring& field_name,
+ virtual void GetAutofillSuggestions(const std::wstring& field_name,
const std::wstring& user_text, int64 node_id, int request_id);
virtual void PageHasOSDD(RenderViewHost* render_view_host,
int32 page_id, const GURL& url, bool autodetected);
@@ -332,7 +332,8 @@ class WebContents : public TabContents,
new_request_id);
}
virtual bool CanBlur() const;
- virtual void RendererUnresponsive(RenderViewHost* render_view_host,
+ virtual gfx::Rect GetRootWindowResizerRect() const;
+ virtual void RendererUnresponsive(RenderViewHost* render_view_host,
bool is_during_unload);
virtual void RendererResponsive(RenderViewHost* render_view_host);
virtual void LoadStateChanged(const GURL& url, net::LoadState load_state);
diff --git a/chrome/browser/views/download_shelf_view.cc b/chrome/browser/views/download_shelf_view.cc
index 5467be7..d4e02ed 100644
--- a/chrome/browser/views/download_shelf_view.cc
+++ b/chrome/browser/views/download_shelf_view.cc
@@ -73,7 +73,7 @@ int CenterPosition(int size, int target_size) {
return std::max((target_size - size) / 2, kTopBottomPadding);
}
-} // namespace
+} // namespace
DownloadShelfView::DownloadShelfView(TabContents* tab_contents)
: tab_contents_(tab_contents) {
@@ -207,6 +207,9 @@ void DownloadShelfView::Layout() {
if (!GetWidget())
return;
+ // Let our base class layout our child views
+ views::View::Layout();
+
gfx::Size image_size = arrow_image_->GetPreferredSize();
gfx::Size close_button_size = close_button_->GetPreferredSize();
gfx::Size show_all_size = show_all_view_->GetPreferredSize();
@@ -270,3 +273,6 @@ void DownloadShelfView::ButtonPressed(views::BaseButton* button) {
shelf_animation_->Hide();
}
+bool DownloadShelfView::IsShowing() const {
+ return shelf_animation_->IsShowing();
+}
diff --git a/chrome/browser/views/download_shelf_view.h b/chrome/browser/views/download_shelf_view.h
index 35213a8..3f157a4 100644
--- a/chrome/browser/views/download_shelf_view.h
+++ b/chrome/browser/views/download_shelf_view.h
@@ -31,7 +31,7 @@ class DownloadShelfView : public views::View,
public views::LinkController,
public AnimationDelegate {
public:
- DownloadShelfView(TabContents* tab_contents);
+ explicit DownloadShelfView(TabContents* tab_contents);
// A new download has started, so add it to our shelf.
void AddDownload(DownloadItem* download);
@@ -68,6 +68,12 @@ class DownloadShelfView : public views::View,
// one.
void ChangeTabContents(TabContents* old_contents, TabContents* new_contents);
+ // The browser view needs to know when we are going away to properly return
+ // the resize corner size to WebKit so that we don't draw on top of it.
+ // This returns the showing state of our animation which is set to false at
+ // the beginning Show and true at the beginning of a Hide.
+ bool IsShowing() const;
+
private:
void Init();
@@ -107,5 +113,5 @@ class DownloadShelfView : public views::View,
DISALLOW_EVIL_CONSTRUCTORS(DownloadShelfView);
};
-#endif // CHROME_BROWSER_VIEWS_DOWNLOAD_SHELF_VIEW_H__
+#endif // CHROME_BROWSER_VIEWS_DOWNLOAD_SHELF_VIEW_H__
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc
index e57b2cc..8ccb3e5 100644
--- a/chrome/browser/views/frame/browser_view.cc
+++ b/chrome/browser/views/frame/browser_view.cc
@@ -47,12 +47,15 @@
#include "chrome/common/resource_bundle.h"
#include "chrome/common/win_util.h"
#include "chrome/views/hwnd_notification_source.h"
+#include "chrome/views/native_scroll_bar.h"
#include "chrome/views/non_client_view.h"
#include "chrome/views/view.h"
#include "chrome/views/window.h"
#include "chromium_strings.h"
#include "generated_resources.h"
+#include "webkit_resources.h"
+
using base::TimeDelta;
@@ -86,7 +89,11 @@ static const int kLoadingAnimationFrameTimeMs = 30;
// If not -1, windows are shown with this state.
static int explicit_show_state = -1;
-static const struct { bool separator; int command; int label; } kMenuLayout[] = {
+static const struct {
+ bool separator;
+ int command;
+ int label;
+} kMenuLayout[] = {
{ true, 0, 0 },
{ false, IDC_TASK_MANAGER, IDS_TASK_MANAGER },
{ true, 0, 0 },
@@ -111,6 +118,53 @@ static const struct { bool separator; int command; int label; } kMenuLayout[] =
};
///////////////////////////////////////////////////////////////////////////////
+// ResizeCorner, private:
+
+class ResizeCorner : public views::View {
+ public:
+ ResizeCorner() {}
+ virtual void Paint(ChromeCanvas* canvas) {
+ SkBitmap * bitmap = ResourceBundle::GetSharedInstance().GetBitmapNamed(
+ IDR_TEXTAREA_RESIZER);
+ bitmap->buildMipMap(false);
+ bool rtl_dir = (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT);
+ if (rtl_dir) {
+ canvas->TranslateInt(width(), 0);
+ canvas->ScaleInt(-1, 1);
+ canvas->save();
+ }
+ canvas->DrawBitmapInt(*bitmap, width() - bitmap->width(),
+ height() - bitmap->height());
+ if (rtl_dir)
+ canvas->restore();
+ }
+
+ static gfx::Size GetSize() {
+ return gfx::Size(views::NativeScrollBar::GetVerticalScrollBarWidth(),
+ views::NativeScrollBar::GetHorizontalScrollBarHeight());
+ }
+
+ virtual gfx::Size GetPreferredSize() {
+ return GetSize();
+ }
+
+ virtual void Layout() {
+ views::View* parent_view = GetParent();
+ if (parent_view) {
+ gfx::Size ps = GetPreferredSize();
+ // No need to handle Right to left text direction here,
+ // our parent must take care of it for us...
+ SetBounds(parent_view->width() - ps.width(),
+ parent_view->height() - ps.height(), ps.width(), ps.height());
+ }
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ResizeCorner);
+};
+
+
+///////////////////////////////////////////////////////////////////////////////
// BrowserView, public:
// static
@@ -119,7 +173,7 @@ void BrowserView::SetShowState(int state) {
}
BrowserView::BrowserView(Browser* browser)
- : ClientView(NULL, NULL),
+ : views::ClientView(NULL, NULL),
frame_(NULL),
browser_(browser),
active_bookmark_bar_(NULL),
@@ -177,7 +231,7 @@ void BrowserView::WindowMoved() {
// Cancel any tabstrip animations, some of them may be invalidated by the
// window being repositioned.
// Comment out for one cycle to see if this fixes dist tests.
- //tabstrip_->DestroyDragController();
+ // tabstrip_->DestroyDragController();
status_bubble_->Reposition();
@@ -491,7 +545,7 @@ gfx::Rect BrowserView::GetNormalBounds() const {
return gfx::Rect(wp.rcNormalPosition);
}
-bool BrowserView::IsMaximized() {
+bool BrowserView::IsMaximized() const {
return frame_->GetWindow()->IsMaximized();
}
@@ -535,6 +589,32 @@ bool BrowserView::IsBookmarkBarVisible() const {
return bookmark_bar_view_->GetPreferredSize().height() > 1;
}
+gfx::Rect BrowserView::GetRootWindowResizerRect() const {
+ // There is no resize corner when we are maximized
+ if (IsMaximized())
+ return gfx::Rect();
+
+ // We don't specify a resize corner size if we have a bottom shelf either.
+ // This is because we take care of drawing the resize corner on top of that
+ // shelf, so we don't want others to do it for us in this case.
+ // Currently, the only visible bottom shelf is the download shelf.
+ // Other tests should be added here if we add more bottom shelves.
+ TabContents* current_tab = browser_->GetSelectedTabContents();
+ if (current_tab && current_tab->IsDownloadShelfVisible()) {
+ DownloadShelfView* download_shelf = current_tab->GetDownloadShelfView();
+ if (download_shelf && download_shelf->IsShowing())
+ return gfx::Rect();
+ }
+
+ gfx::Rect client_rect = contents_container_->bounds();
+ gfx::Size resize_corner_size = ResizeCorner::GetSize();
+ int x = client_rect.width() - resize_corner_size.width();
+ if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT)
+ x = 0;
+ return gfx::Rect(x, client_rect.height() - resize_corner_size.height(),
+ resize_corner_size.width(), resize_corner_size.height());
+}
+
void BrowserView::ToggleBookmarkBar() {
BookmarkBarView::ToggleWhenVisible(browser_->profile());
}
@@ -887,6 +967,24 @@ int BrowserView::NonClientHitTest(const gfx::Point& point) {
// area of the window. So we need to treat hit-tests in these regions as
// hit-tests of the titlebar.
+ // There is not resize corner when we are maximised
+ if (!IsMaximized()) {
+ CRect client_rect;
+ ::GetClientRect(frame_->GetWindow()->GetHWND(), &client_rect);
+ gfx::Size resize_corner_size = ResizeCorner::GetSize();
+ gfx::Rect resize_corner_rect(client_rect.right - resize_corner_size.width(),
+ client_rect.bottom - resize_corner_size.height(),
+ resize_corner_size.width(), resize_corner_size.height());
+ bool rtl_dir = (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT);
+ if (rtl_dir)
+ resize_corner_rect.set_x(0);
+ if (resize_corner_rect.Contains(point)) {
+ if (rtl_dir)
+ return HTBOTTOMLEFT;
+ return HTBOTTOMRIGHT;
+ }
+ }
+
// Determine if the TabStrip exists and is capable of being clicked on. We
// might be a popup window without a TabStrip, or the TabStrip could be
// animating.
@@ -940,7 +1038,7 @@ int BrowserView::NonClientHitTest(const gfx::Point& point) {
return HTNOWHERE;
// If the point is somewhere else, delegate to the default implementation.
- return ClientView::NonClientHitTest(point);
+ return views::ClientView::NonClientHitTest(point);
}
///////////////////////////////////////////////////////////////////////////////
@@ -1119,7 +1217,7 @@ int BrowserView::LayoutBookmarkAndInfoBars(int top) {
return LayoutBookmarkBar(top);
}
- // If we're showing a regular bookmark bar and it's not below an infobar,
+ // If we're showing a regular bookmark bar and it's not below an infobar,
// make it overlap the toolbar so that the bar items can be drawn higher.
if (active_bookmark_bar_)
top -= bookmark_bar_view_->GetToolbarOverlap();
@@ -1200,8 +1298,11 @@ bool BrowserView::MaybeShowInfoBar(TabContents* contents) {
bool BrowserView::MaybeShowDownloadShelf(TabContents* contents) {
views::View* new_shelf = NULL;
- if (contents && contents->IsDownloadShelfVisible())
+ if (contents && contents->IsDownloadShelfVisible()) {
new_shelf = contents->GetDownloadShelfView();
+ if (new_shelf != active_download_shelf_)
+ new_shelf->AddChildView(new ResizeCorner());
+ }
return UpdateChildViewAndLayout(new_shelf, &active_download_shelf_);
}
diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h
index 7be0501..ba247c9 100644
--- a/chrome/browser/views/frame/browser_view.h
+++ b/chrome/browser/views/frame/browser_view.h
@@ -172,13 +172,14 @@ class BrowserView : public BrowserWindow,
virtual void UpdateLoadingAnimations(bool should_animate);
virtual void SetStarredState(bool is_starred);
virtual gfx::Rect GetNormalBounds() const;
- virtual bool IsMaximized();
+ virtual bool IsMaximized() const;
virtual LocationBar* GetLocationBar() const;
virtual void UpdateStopGoState(bool is_loading);
virtual void UpdateToolbar(TabContents* contents, bool should_restore_state);
virtual void FocusToolbar();
virtual void DestroyBrowser();
virtual bool IsBookmarkBarVisible() const;
+ virtual gfx::Rect GetRootWindowResizerRect() const;
virtual void ToggleBookmarkBar();
virtual void ShowAboutChromeDialog();
virtual void ShowBookmarkManager();
@@ -428,4 +429,4 @@ class BrowserView : public BrowserWindow,
DISALLOW_EVIL_CONSTRUCTORS(BrowserView);
};
-#endif // #ifndef CHROME_BROWSER_VIEWS_FRAME_BROWSER_VIEW_H_
+#endif // CHROME_BROWSER_VIEWS_FRAME_BROWSER_VIEW_H_