diff options
32 files changed, 168 insertions, 324 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 8b6af85..e9c48f1 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,10 +1874,6 @@ 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 0fc72a0..1874426 100644 --- a/chrome/browser/browser.h +++ b/chrome/browser/browser.h @@ -391,9 +391,8 @@ 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(); @@ -491,7 +490,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 2809d2e..1b382ae 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() const = 0; + virtual bool IsMaximized() = 0; // Returns the location bar. virtual LocationBar* GetLocationBar() const = 0; @@ -102,12 +102,6 @@ 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; @@ -132,7 +126,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 e719aa1..fa7e707 100644 --- a/chrome/browser/browser_window_cocoa.h +++ b/chrome/browser/browser_window_cocoa.h @@ -34,14 +34,13 @@ class BrowserWindowCocoa : public BrowserWindow { virtual void UpdateLoadingAnimations(bool should_animate); virtual void SetStarredState(bool is_starred); virtual gfx::Rect GetNormalBounds() const; - virtual bool IsMaximized() const; + virtual bool IsMaximized(); 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 7f313729..c541985 100644 --- a/chrome/browser/browser_window_cocoa.mm +++ b/chrome/browser/browser_window_cocoa.mm @@ -83,14 +83,10 @@ gfx::Rect BrowserWindowCocoa::GetNormalBounds() const { return bounds; } -bool BrowserWindowCocoa::IsMaximized() const { +bool BrowserWindowCocoa::IsMaximized() { 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.h b/chrome/browser/browser_window_gtk.h index d6e1104..6fa093b 100644 --- a/chrome/browser/browser_window_gtk.h +++ b/chrome/browser/browser_window_gtk.h @@ -36,14 +36,13 @@ class BrowserWindowGtk : public BrowserWindow { virtual void UpdateLoadingAnimations(bool should_animate); virtual void SetStarredState(bool is_starred); virtual gfx::Rect GetNormalBounds() const; - virtual bool IsMaximized() const; + virtual bool IsMaximized(); 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 cf9be2d..e244c83 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -150,8 +150,7 @@ 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()); @@ -309,7 +308,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); @@ -383,8 +382,7 @@ 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)); @@ -517,8 +515,7 @@ 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); } @@ -575,8 +572,7 @@ 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() { @@ -940,8 +936,7 @@ 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( @@ -1278,10 +1273,6 @@ 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 9d0bb37..2cd9d29 100644 --- a/chrome/browser/renderer_host/render_view_host.h +++ b/chrome/browser/renderer_host/render_view_host.h @@ -410,7 +410,6 @@ 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 b701b21..f048dc2 100644 --- a/chrome/browser/renderer_host/render_view_host_delegate.h +++ b/chrome/browser/renderer_host/render_view_host_delegate.h @@ -10,7 +10,6 @@ #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" @@ -39,6 +38,10 @@ namespace IPC { class Message; } +namespace gfx { +class Rect; +} + namespace webkit_glue { struct WebApplicationInfo; } @@ -298,13 +301,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) { } @@ -369,13 +372,9 @@ 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 e196a00..a6d289b 100644 --- a/chrome/browser/renderer_host/render_widget_host.cc +++ b/chrome/browser/renderer_host/render_widget_host.cc @@ -164,8 +164,7 @@ void RenderWidgetHost::WasResized() { if (!new_size.IsEmpty()) resize_ack_pending_ = true; - if (!Send(new ViewMsg_Resize(routing_id_, new_size, - GetRootWindowResizerRect()))) + if (!Send(new ViewMsg_Resize(routing_id_, new_size))) resize_ack_pending_ = false; } @@ -331,10 +330,6 @@ 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 48fc912..4bd1849 100644 --- a/chrome/browser/renderer_host/render_widget_host.h +++ b/chrome/browser/renderer_host/render_widget_host.h @@ -205,10 +205,6 @@ 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 65a3921..b499669 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc @@ -20,15 +20,12 @@ #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; @@ -246,40 +243,28 @@ 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) { - 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); - } - } + if (WindowFromPoint(pt) == m_hWnd) + SetCursor(display_cursor); } void RenderWidgetHostViewWin::SetIsLoading(bool is_loading) { @@ -337,37 +322,6 @@ 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; @@ -480,7 +434,6 @@ 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(), @@ -769,20 +722,6 @@ 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 167f529..ec1547a 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.h +++ b/chrome/browser/renderer_host/render_widget_host_view_win.h @@ -213,10 +213,6 @@ 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 51c4875..2db7124 100644 --- a/chrome/browser/renderer_host/resource_message_filter.cc +++ b/chrome/browser/renderer_host/resource_message_filter.cc @@ -205,6 +205,8 @@ 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) @@ -539,6 +541,12 @@ 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 7bb8090..c4d75e3 100644 --- a/chrome/browser/renderer_host/resource_message_filter.h +++ b/chrome/browser/renderer_host/resource_message_filter.h @@ -150,6 +150,7 @@ 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 59ad1ae..cf6b1ab 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -400,7 +400,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) { @@ -408,7 +408,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 05f5e79..428f98e 100644 --- a/chrome/browser/tab_contents/tab_contents_delegate.h +++ b/chrome/browser/tab_contents/tab_contents_delegate.h @@ -6,10 +6,14 @@ #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; @@ -26,7 +30,8 @@ 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); } @@ -101,7 +106,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) {} @@ -114,10 +119,6 @@ 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 @@ -128,17 +129,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 6df85ac..1670493 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,21 +1278,16 @@ bool WebContents::CanBlur() const { return delegate() ? delegate()->CanBlur() : true; } -gfx::Rect WebContents::GetRootWindowResizerRect() const { - if (delegate()) - return delegate()->GetRootWindowResizerRect(); - return gfx::Rect(); -} - -void WebContents::RendererUnresponsive(RenderViewHost* rvh, +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 @@ -1657,7 +1652,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 bd1c2ce..7bb858c 100644 --- a/chrome/browser/tab_contents/web_contents.h +++ b/chrome/browser/tab_contents/web_contents.h @@ -212,7 +212,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) { @@ -306,7 +306,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); @@ -330,8 +330,7 @@ class WebContents : public TabContents, new_request_id); } virtual bool CanBlur() const; - virtual gfx::Rect GetRootWindowResizerRect() const; - virtual void RendererUnresponsive(RenderViewHost* render_view_host, + 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 d4e02ed..5467be7 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,9 +207,6 @@ 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(); @@ -273,6 +270,3 @@ 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 3f157a4..35213a8 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: - explicit DownloadShelfView(TabContents* tab_contents); + DownloadShelfView(TabContents* tab_contents); // A new download has started, so add it to our shelf. void AddDownload(DownloadItem* download); @@ -68,12 +68,6 @@ 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(); @@ -113,5 +107,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 8ccb3e5..e57b2cc 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -47,15 +47,12 @@ #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; @@ -89,11 +86,7 @@ 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 }, @@ -118,53 +111,6 @@ static const struct { }; /////////////////////////////////////////////////////////////////////////////// -// 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 @@ -173,7 +119,7 @@ void BrowserView::SetShowState(int state) { } BrowserView::BrowserView(Browser* browser) - : views::ClientView(NULL, NULL), + : ClientView(NULL, NULL), frame_(NULL), browser_(browser), active_bookmark_bar_(NULL), @@ -231,7 +177,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(); @@ -545,7 +491,7 @@ gfx::Rect BrowserView::GetNormalBounds() const { return gfx::Rect(wp.rcNormalPosition); } -bool BrowserView::IsMaximized() const { +bool BrowserView::IsMaximized() { return frame_->GetWindow()->IsMaximized(); } @@ -589,32 +535,6 @@ 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()); } @@ -967,24 +887,6 @@ 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. @@ -1038,7 +940,7 @@ int BrowserView::NonClientHitTest(const gfx::Point& point) { return HTNOWHERE; // If the point is somewhere else, delegate to the default implementation. - return views::ClientView::NonClientHitTest(point); + return ClientView::NonClientHitTest(point); } /////////////////////////////////////////////////////////////////////////////// @@ -1217,7 +1119,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(); @@ -1298,11 +1200,8 @@ 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 ba247c9..7be0501 100644 --- a/chrome/browser/views/frame/browser_view.h +++ b/chrome/browser/views/frame/browser_view.h @@ -172,14 +172,13 @@ class BrowserView : public BrowserWindow, virtual void UpdateLoadingAnimations(bool should_animate); virtual void SetStarredState(bool is_starred); virtual gfx::Rect GetNormalBounds() const; - virtual bool IsMaximized() const; + virtual bool IsMaximized(); 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(); @@ -429,4 +428,4 @@ class BrowserView : public BrowserWindow, DISALLOW_EVIL_CONSTRUCTORS(BrowserView); }; -#endif // CHROME_BROWSER_VIEWS_FRAME_BROWSER_VIEW_H_ +#endif // #ifndef CHROME_BROWSER_VIEWS_FRAME_BROWSER_VIEW_H_ diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index d51af0e..e6b401e 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -70,11 +70,9 @@ IPC_BEGIN_MESSAGES(View) // Tells the render view to change its size. A ViewHostMsg_PaintRect message // is generated in response provided new_size is not empty and not equal to // the view's current size. The generated ViewHostMsg_PaintRect message will - // have the IS_RESIZE_ACK flag set. It also receives the resizer rect so that - // we don't have to fetch it every time WebKit asks for it. - IPC_MESSAGE_ROUTED2(ViewMsg_Resize, - gfx::Size /* new_size */, - gfx::Rect /* resizer_rect */) + // have the IS_RESIZE_ACK flag set. + IPC_MESSAGE_ROUTED1(ViewMsg_Resize, + gfx::Size /* new_size */) // Sent to inform the view that it was hidden. This allows it to reduce its // resource utilization. diff --git a/chrome/common/slide_animation.h b/chrome/common/slide_animation.h index d998e6c..f690e48 100644 --- a/chrome/common/slide_animation.h +++ b/chrome/common/slide_animation.h @@ -73,7 +73,7 @@ class SlideAnimation : public Animation { void SetTweenType(TweenType tween_type) { tween_type_ = tween_type; } double GetCurrentValue() const { return value_current_; } - bool IsShowing() const { return showing_; } + bool IsShowing() { return showing_; } private: // Overridden from Animation. diff --git a/chrome/common/temp_scaffolding_stubs.h b/chrome/common/temp_scaffolding_stubs.h index 0548dda..26a47c6 100644 --- a/chrome/common/temp_scaffolding_stubs.h +++ b/chrome/common/temp_scaffolding_stubs.h @@ -590,10 +590,6 @@ class TabContentsDelegate { NOTIMPLEMENTED(); return true; } - virtual gfx::Rect GetRootWindowResizerRect() const { - return gfx::Rect(); - } - virtual bool IsExternalTabContainer() { NOTIMPLEMENTED(); return false; diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc index ad801b0..82ca86c 100644 --- a/chrome/renderer/render_widget.cc +++ b/chrome/renderer/render_widget.cc @@ -229,15 +229,11 @@ void RenderWidget::OnClose() { } } -void RenderWidget::OnResize(const gfx::Size& new_size, - const gfx::Rect& resizer_rect) { +void RenderWidget::OnResize(const gfx::Size& new_size) { // During shutdown we can just ignore this message. if (!webwidget_) return; - // Remember the rect where the resize corner will be drawn. - resizer_rect_ = resizer_rect; - // TODO(darin): We should not need to reset this here. is_hidden_ = false; needs_repainting_on_restore_ = false; @@ -698,7 +694,8 @@ void RenderWidget::GetRootWindowRect(WebWidget* webwidget, gfx::Rect* rect) { void RenderWidget::GetRootWindowResizerRect(WebWidget* webwidget, gfx::Rect* rect) { - *rect = resizer_rect_; + Send(new ViewHostMsg_GetRootWindowResizerRect(routing_id_, host_window_, + rect)); } void RenderWidget::OnImeSetInputMode(bool is_active) { diff --git a/chrome/renderer/render_widget.h b/chrome/renderer/render_widget.h index 9b5f1c4..8e37b83 100644 --- a/chrome/renderer/render_widget.h +++ b/chrome/renderer/render_widget.h @@ -120,7 +120,7 @@ class RenderWidget : public IPC::Channel::Listener, // RenderWidget IPC message handlers void OnClose(); void OnCreatingNewAck(gfx::NativeViewId parent); - void OnResize(const gfx::Size& new_size, const gfx::Rect& resizer_rect); + void OnResize(const gfx::Size& new_size); void OnWasHidden(); void OnWasRestored(bool needs_repainting); void OnPaintRectAck(); @@ -204,9 +204,6 @@ class RenderWidget : public IPC::Channel::Listener, // scroll event is pending. gfx::Rect scroll_rect_; - // The area that must be reserved for drawing the resize corner. - gfx::Rect resizer_rect_; - // The scroll delta for a pending scroll event. gfx::Point scroll_delta_; @@ -265,4 +262,4 @@ class RenderWidget : public IPC::Channel::Listener, DISALLOW_EVIL_CONSTRUCTORS(RenderWidget); }; -#endif // CHROME_RENDERER_RENDER_WIDGET_H__ +#endif // CHROME_RENDERER_RENDER_WIDGET_H__ diff --git a/chrome/test/test_browser_window.h b/chrome/test/test_browser_window.h index 0dbff2d..fef495a 100644 --- a/chrome/test/test_browser_window.h +++ b/chrome/test/test_browser_window.h @@ -34,7 +34,7 @@ class TestBrowserWindow : public BrowserWindow { virtual void UpdateLoadingAnimations(bool should_animate) {} virtual void SetStarredState(bool is_starred) {} virtual gfx::Rect GetNormalBounds() const { return gfx::Rect(); } - virtual bool IsMaximized() const { return false; } + virtual bool IsMaximized() { return false; } virtual LocationBar* GetLocationBar() const { return const_cast<TestLocationBar*>(&location_bar_); } @@ -43,7 +43,6 @@ class TestBrowserWindow : public BrowserWindow { bool should_restore_state) {} virtual void FocusToolbar() {} virtual bool IsBookmarkBarVisible() const { return false; } - virtual gfx::Rect GetRootWindowResizerRect() const { return gfx::Rect(); } virtual void ToggleBookmarkBar() {} virtual void ShowAboutChromeDialog() {} virtual void ShowBookmarkManager() {} diff --git a/chrome/views/resize_corner.cc b/chrome/views/resize_corner.cc new file mode 100644 index 0000000..97925ca --- /dev/null +++ b/chrome/views/resize_corner.cc @@ -0,0 +1,33 @@ +// Copyright (c) 2006-2008 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/views/resize_corner.h" + +#include <vssym32.h> + +#include "base/gfx/native_theme.h" +#include "chrome/common/gfx/chrome_canvas.h" + +namespace views { + +ResizeCorner::ResizeCorner() { +} + +ResizeCorner::~ResizeCorner() { +} + +void ResizeCorner::Paint(ChromeCanvas* canvas) { + // Paint the little handle. + RECT widgetRect = { 0, 0, width(), height() }; + HDC hdc = canvas->beginPlatformPaint(); + gfx::NativeTheme::instance()->PaintStatusGripper(hdc, + SP_GRIPPER, + 0, + 0, + &widgetRect); + canvas->endPlatformPaint(); +} + +} // namespace views + diff --git a/chrome/views/resize_corner.h b/chrome/views/resize_corner.h new file mode 100644 index 0000000..ed02216 --- /dev/null +++ b/chrome/views/resize_corner.h @@ -0,0 +1,28 @@ +// Copyright (c) 2006-2008 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_VIEWS_RESIZE_CORNER_H__ +#define CHROME_VIEWS_RESIZE_CORNER_H__ + +#include "chrome/views/view.h" + +namespace views { + +// Simple drawing of a resize corner. Has no functionality. +class ResizeCorner : public View { + public: + ResizeCorner(); + virtual ~ResizeCorner(); + + // View + virtual void Paint(ChromeCanvas* canvas); + + private: + DISALLOW_EVIL_CONSTRUCTORS(ResizeCorner); +}; + +} // namespace views + +#endif // CHROME_VIEWS_RESIZE_CORNER_H__ + diff --git a/chrome/views/views.vcproj b/chrome/views/views.vcproj index 9656303..6d5ce3d 100644 --- a/chrome/views/views.vcproj +++ b/chrome/views/views.vcproj @@ -466,6 +466,14 @@ > </File> <File + RelativePath=".\resize_corner.cc" + > + </File> + <File + RelativePath=".\resize_corner.h" + > + </File> + <File RelativePath=".\root_view.cc" > </File> |