diff options
Diffstat (limited to 'chrome/browser')
71 files changed, 207 insertions, 217 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index c7bb3d5..e4b4bf6 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -1143,7 +1143,7 @@ void AutomationProvider::WindowGetViewBounds(const IPC::Message& message, if (window_tracker_->ContainsHandle(handle)) { HWND hwnd = window_tracker_->GetResource(handle); ChromeViews::RootView* root_view = - ChromeViews::HWNDViewContainer::FindRootView(hwnd); + ChromeViews::ContainerWin::FindRootView(hwnd); if (root_view) { ChromeViews::View* view = root_view->GetViewByID(view_id); if (view) { diff --git a/chrome/browser/automation/ui_controls.cc b/chrome/browser/automation/ui_controls.cc index ab5f572..f87490e 100644 --- a/chrome/browser/automation/ui_controls.cc +++ b/chrome/browser/automation/ui_controls.cc @@ -335,7 +335,7 @@ bool SendMouseClick(MouseButton type) { void MoveMouseToCenterAndPress( ChromeViews::View* view, MouseButton button, int state, Task* task) { DCHECK(view); - DCHECK(view->GetViewContainer()); + DCHECK(view->GetContainer()); gfx::Point view_center(view->width() / 2, view->height() / 2); ChromeViews::View::ConvertPointToScreen(view, &view_center); SendMouseMove(view_center.x(), view_center.y()); diff --git a/chrome/browser/bookmark_bar_context_menu_controller.cc b/chrome/browser/bookmark_bar_context_menu_controller.cc index d7c1010d..75d33b8 100644 --- a/chrome/browser/bookmark_bar_context_menu_controller.cc +++ b/chrome/browser/bookmark_bar_context_menu_controller.cc @@ -16,7 +16,7 @@ #include "chrome/common/l10n_util.h" #include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" -#include "chrome/views/view_container.h" +#include "chrome/views/container.h" #include "chrome/views/window.h" #include "chromium_strings.h" @@ -121,7 +121,7 @@ class EditFolderController : public InputWindowDelegate, visual_order_(visual_order), is_new_(is_new) { DCHECK(is_new_ || node); - window_ = CreateInputWindow(view->GetViewContainer()->GetHWND(), this); + window_ = CreateInputWindow(view->GetContainer()->GetHWND(), this); view_->SetModelChangedListener(this); } @@ -274,7 +274,7 @@ void BookmarkBarContextMenuController::RunMenuAt(int x, int y) { view_->SetModelChangedListener(this); // width/height don't matter here. - menu_.RunMenuAt(view_->GetViewContainer()->GetHWND(), gfx::Rect(x, y, 0, 0), + menu_.RunMenuAt(view_->GetContainer()->GetHWND(), gfx::Rect(x, y, 0, 0), ChromeViews::MenuItemView::TOPLEFT, true); if (view_->GetModelChangedListener() == this) @@ -328,9 +328,9 @@ void BookmarkBarContextMenuController::ExecuteCommand(int id) { else initial_disposition = CURRENT_TAB; - // GetViewContainer is NULL during testing. - HWND parent_hwnd = view_->GetViewContainer() ? - view_->GetViewContainer()->GetHWND() : 0; + // GetContainer is NULL during testing. + HWND parent_hwnd = view_->GetContainer() ? + view_->GetContainer()->GetHWND() : 0; OpenAll(parent_hwnd, view_->GetPageNavigator(), node_, initial_disposition); @@ -341,7 +341,7 @@ void BookmarkBarContextMenuController::ExecuteCommand(int id) { UserMetrics::RecordAction(L"BookmarkBar_ContextMenu_Edit", profile); if (node_->GetType() == history::StarredEntry::URL) { - BookmarkEditorView::Show(view_->GetViewContainer()->GetHWND(), + BookmarkEditorView::Show(view_->GetContainer()->GetHWND(), view_->GetProfile(), NULL, node_); } else { // Controller deletes itself when done. @@ -362,7 +362,7 @@ void BookmarkBarContextMenuController::ExecuteCommand(int id) { case add_bookmark_id: { UserMetrics::RecordAction(L"BookmarkBar_ContextMenu_Add", profile); - BookmarkEditorView::Show(view_->GetViewContainer()->GetHWND(), + BookmarkEditorView::Show(view_->GetContainer()->GetHWND(), view_->GetProfile(), node_, NULL); break; } diff --git a/chrome/browser/browser_commands.cc b/chrome/browser/browser_commands.cc index cca8754..eb1d405 100644 --- a/chrome/browser/browser_commands.cc +++ b/chrome/browser/browser_commands.cc @@ -1027,8 +1027,8 @@ void Browser::DuplicateContentsAt(int index) { Browser* new_browser = new Browser(gfx::Rect(), SW_SHOWNORMAL, profile(), BrowserType::APPLICATION, app_name_); - // We need to show the browser now. Otherwise HWNDViewContainer assumes - // the tab contents is invisible and won't size it. + // We need to show the browser now. Otherwise ContainerWin assumes the + // TabContents is invisible and won't size it. new_browser->Show(); // The page transition below is only for the purpose of inserting the tab. diff --git a/chrome/browser/browser_uitest.cc b/chrome/browser/browser_uitest.cc index 842b7d8..f564d4f 100644 --- a/chrome/browser/browser_uitest.cc +++ b/chrome/browser/browser_uitest.cc @@ -12,7 +12,7 @@ #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/automation/window_proxy.h" #include "chrome/test/ui/ui_test.h" -#include "chrome/views/view_container.h" +#include "chrome/views/container.h" #include "net/base/net_util.h" #include "net/url_request/url_request_unittest.h" diff --git a/chrome/browser/debugger/debugger_view.cc b/chrome/browser/debugger/debugger_view.cc index 34b4de5..f6cac90 100644 --- a/chrome/browser/debugger/debugger_view.cc +++ b/chrome/browser/debugger/debugger_view.cc @@ -55,7 +55,7 @@ void DebuggerView::ViewHierarchyChanged(bool is_add, ChromeViews::View* parent, ChromeViews::View* child) { if (is_add && child == this) { - DCHECK(GetViewContainer()); + DCHECK(GetContainer()); OnInit(); } } diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc index c6188c3..abf033f 100644 --- a/chrome/browser/external_tab_container.cc +++ b/chrome/browser/external_tab_container.cc @@ -13,7 +13,8 @@ #include "chrome/browser/web_contents.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/win_util.h" -#include "chrome/views/hwnd_view_container.h" +// Included for SetRootViewForHWND. +#include "chrome/views/container_win.h" #include "chrome/test/automation/automation_messages.h" static const wchar_t kWindowObjectKey[] = L"ChromeWindowObject"; diff --git a/chrome/browser/external_tab_container.h b/chrome/browser/external_tab_container.h index b0f4909..2e3d589 100644 --- a/chrome/browser/external_tab_container.h +++ b/chrome/browser/external_tab_container.h @@ -15,9 +15,9 @@ #include "chrome/common/chrome_constants.h" #include "chrome/common/notification_registrar.h" #include "chrome/common/notification_service.h" +#include "chrome/views/container.h" #include "chrome/views/focus_manager.h" #include "chrome/views/root_view.h" -#include "chrome/views/view_container.h" class AutomationProvider; class TabContents; @@ -27,10 +27,10 @@ class TabContentsContainerView; // An external tab is a Chrome tab that is meant to displayed in an // external process. This class provides the FocusManger needed by the // TabContents as well as an implementation of TabContentsDelagate. -// It also implements ViewContainer +// It also implements Container class ExternalTabContainer : public TabContentsDelegate, public NotificationObserver, - public ChromeViews::ViewContainer, + public ChromeViews::Container, public ChromeViews::KeystrokeListener, public CWindowImpl<ExternalTabContainer, CWindow, @@ -88,7 +88,7 @@ class ExternalTabContainer : public TabContentsDelegate, const NotificationDetails& details); //////////////////////////////////////////////////////////////////////////////// - // ChromeViews::ViewContainer + // ChromeViews::Container //////////////////////////////////////////////////////////////////////////////// virtual void GetBounds(CRect *out, bool including_frame) const; virtual void MoveToFront(bool should_activate); diff --git a/chrome/browser/find_in_page_controller.cc b/chrome/browser/find_in_page_controller.cc index 86f7e84..0646ced 100644 --- a/chrome/browser/find_in_page_controller.cc +++ b/chrome/browser/find_in_page_controller.cc @@ -11,8 +11,8 @@ #include "chrome/browser/tab_contents.h" #include "chrome/browser/view_ids.h" #include "chrome/browser/views/bookmark_bar_view.h" +#include "chrome/views/container_win.h" #include "chrome/views/external_focus_tracker.h" -#include "chrome/views/hwnd_view_container.h" #include "chrome/views/native_scroll_bar.h" #include "chrome/views/root_view.h" #include "chrome/views/view_storage.h" @@ -41,9 +41,9 @@ FindInPageController::FindInPageController(TabContents* parent_tab, // own handler for Escape. SetFocusChangeListener(parent_hwnd); - // Don't let HWNDViewContainer manage our lifetime. We want our lifetime to + // Don't let ContainerWin manage our lifetime. We want our lifetime to // coincide with WebContents. - HWNDViewContainer::set_delete_on_destroy(false); + ContainerWin::set_delete_on_destroy(false); view_ = new FindInPageView(this); @@ -60,7 +60,7 @@ FindInPageController::FindInPageController(TabContents* parent_tab, gfx::Rect find_dlg_rect = GetDialogPosition(gfx::Rect()); set_window_style(WS_CHILD | WS_CLIPCHILDREN); set_window_ex_style(WS_EX_TOPMOST); - HWNDViewContainer::Init(parent_hwnd, find_dlg_rect, false); + ContainerWin::Init(parent_hwnd, find_dlg_rect, false); SetContentsView(view_); // Start the process of animating the opening of the window. @@ -326,7 +326,7 @@ void FindInPageController::SetParent(HWND new_parent) { } //////////////////////////////////////////////////////////////////////////////// -// FindInPageController, ChromeViews::HWNDViewContainer implementation: +// FindInPageController, ChromeViews::ContainerWin implementation: void FindInPageController::OnFinalMessage(HWND window) { // We are exiting, so we no longer need to monitor focus changes. @@ -487,12 +487,12 @@ void FindInPageController::GetDialogBounds(gfx::Rect* bounds) { toolbar->GetLocalBounds(&local_bounds, false); toolbar_bounds = gfx::Rect(local_bounds); } - // Need to convert toolbar bounds into ViewContainer coords because the - // toolbar is the child of another view that isn't the top level view. - // This is required to ensure correct positioning relative to the top,left - // of the window. + // Need to convert toolbar bounds into Container coords because the toolbar + // is the child of another view that isn't the top level view. This is + // required to ensure correct positioning relative to the top,left of the + // window. gfx::Point topleft; - ChromeViews::View::ConvertPointToViewContainer(toolbar, &topleft); + ChromeViews::View::ConvertPointToContainer(toolbar, &topleft); toolbar_bounds.Offset(topleft.x(), topleft.y()); } diff --git a/chrome/browser/find_in_page_controller.h b/chrome/browser/find_in_page_controller.h index 5ddef23..733d068 100644 --- a/chrome/browser/find_in_page_controller.h +++ b/chrome/browser/find_in_page_controller.h @@ -8,7 +8,7 @@ #include "base/gfx/rect.h" #include "chrome/browser/render_view_host_delegate.h" #include "chrome/common/animation.h" -#include "chrome/views/hwnd_view_container.h" +#include "chrome/views/container_win.h" class FindInPageView; class SlideAnimation; @@ -34,7 +34,7 @@ namespace ChromeViews { //////////////////////////////////////////////////////////////////////////////// class FindInPageController : public RenderViewHostDelegate::FindInPage, public ChromeViews::FocusChangeListener, - public ChromeViews::HWNDViewContainer, + public ChromeViews::ContainerWin, public AnimationDelegate { public: FindInPageController(TabContents* parent_tab, @@ -107,7 +107,7 @@ class FindInPageController : public RenderViewHostDelegate::FindInPage, find_string_ = find_string; } - // Overridden from ChromeViews::HWNDViewContainer: + // Overridden from ChromeViews::ContainerWin: virtual void OnFinalMessage(HWND window); // Overridden from ChromeViews::FocusChangeListener: diff --git a/chrome/browser/find_in_page_view.cc b/chrome/browser/find_in_page_view.cc index 813dc10..da14afe 100644 --- a/chrome/browser/find_in_page_view.cc +++ b/chrome/browser/find_in_page_view.cc @@ -13,7 +13,6 @@ #include "chrome/common/gfx/chrome_canvas.h" #include "chrome/common/resource_bundle.h" #include "chrome/views/background.h" -#include "chrome/views/hwnd_view_container.h" #include "chrome/views/label.h" #include "skia/include/SkGradientShader.h" diff --git a/chrome/browser/history_view.cc b/chrome/browser/history_view.cc index 6cac8f1..ef439eb 100644 --- a/chrome/browser/history_view.cc +++ b/chrome/browser/history_view.cc @@ -22,6 +22,7 @@ #include "chrome/common/resource_bundle.h" #include "chrome/common/time_format.h" #include "chrome/common/win_util.h" +#include "chrome/views/container.h" #include "chrome/views/link.h" #include "generated_resources.h" @@ -562,7 +563,7 @@ void HistoryItemRenderer::StarStateChanged(bool state) { gfx::Rect star_bounds(star_location.x(), star_location.y() + 4, star_toggle_->width(), star_toggle_->height()); - HWND parent = GetViewContainer()->GetHWND(); + HWND parent = GetContainer()->GetHWND(); Profile* profile = model_->profile(); GURL url = model_->GetURL(model_index_); @@ -835,7 +836,7 @@ ChromeViews::VariableRowHeightScrollHelper::RowInfo } bool HistoryView::IsVisible() { - ChromeViews::ViewContainer* vc = GetViewContainer(); + ChromeViews::Container* vc = GetContainer(); return vc && vc->IsVisible(); } @@ -1242,7 +1243,7 @@ void HistoryView::DeleteDayAtModelIndex(int index) { IDS_HISTORY_DELETE_PRIOR_VISITS_WARNING_TITLE); UINT flags = MB_OKCANCEL | MB_ICONWARNING | MB_TOPMOST | MB_SETFOREGROUND; - if (win_util::MessageBox(GetViewContainer()->GetHWND(), + if (win_util::MessageBox(GetContainer()->GetHWND(), text, caption, flags) != IDOK) { return; } diff --git a/chrome/browser/native_ui_contents.cc b/chrome/browser/native_ui_contents.cc index ef81dbd..785ca8a 100644 --- a/chrome/browser/native_ui_contents.cc +++ b/chrome/browser/native_ui_contents.cc @@ -16,8 +16,8 @@ #include "chrome/common/resource_bundle.h" #include "chrome/views/background.h" #include "chrome/views/checkbox.h" +#include "chrome/views/container_win.h" #include "chrome/views/grid_layout.h" -#include "chrome/views/hwnd_view_container.h" #include "chrome/views/image_view.h" #include "chrome/views/root_view.h" #include "chrome/views/scroll_view.h" @@ -151,7 +151,7 @@ NativeUIContents::~NativeUIContents() { void NativeUIContents::CreateView(HWND parent_hwnd, const gfx::Rect& initial_bounds) { set_delete_on_destroy(false); - HWNDViewContainer::Init(parent_hwnd, initial_bounds, false); + ContainerWin::Init(parent_hwnd, initial_bounds, false); } LRESULT NativeUIContents::OnCreate(LPCREATESTRUCT create_struct) { diff --git a/chrome/browser/native_ui_contents.h b/chrome/browser/native_ui_contents.h index 443e3be..d333fcf 100644 --- a/chrome/browser/native_ui_contents.h +++ b/chrome/browser/native_ui_contents.h @@ -8,7 +8,7 @@ #include "chrome/browser/page_state.h" #include "chrome/browser/tab_contents.h" #include "chrome/views/background.h" -#include "chrome/views/hwnd_view_container.h" +#include "chrome/views/container_win.h" #include "chrome/views/link.h" #include "chrome/views/native_button.h" #include "chrome/views/text_field.h" @@ -33,7 +33,7 @@ class NativeUI; // //////////////////////////////////////////////////////////////////////////////// class NativeUIContents : public TabContents, - public ChromeViews::HWNDViewContainer { + public ChromeViews::ContainerWin { public: explicit NativeUIContents(Profile* profile); diff --git a/chrome/browser/network_status_view.cc b/chrome/browser/network_status_view.cc index 4a0e57c..74fff7f 100644 --- a/chrome/browser/network_status_view.cc +++ b/chrome/browser/network_status_view.cc @@ -11,7 +11,6 @@ #include "chrome/browser/browser.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/tab_contents_delegate.h" -#include "chrome/views/hwnd_view_container.h" #include "chrome/views/root_view.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_job.h" diff --git a/chrome/browser/network_status_view.h b/chrome/browser/network_status_view.h index bae43fa..2170f73 100644 --- a/chrome/browser/network_status_view.h +++ b/chrome/browser/network_status_view.h @@ -16,9 +16,6 @@ class MessageLoop; class RenderProcessHost; class NavigationPerformanceViewer; class PageLoadView; -namespace ChromeViews { -class HWNDViewContainer; -} class NetworkStatusView : public StatusView { public: diff --git a/chrome/browser/render_widget_host_view_win.cc b/chrome/browser/render_widget_host_view_win.cc index bc9c283..d32e658 100644 --- a/chrome/browser/render_widget_host_view_win.cc +++ b/chrome/browser/render_widget_host_view_win.cc @@ -21,7 +21,9 @@ #include "chrome/common/l10n_util.h" #include "chrome/common/plugin_messages.h" #include "chrome/common/win_util.h" -#include "chrome/views/hwnd_view_container.h" +// Included for ChromeViews::kReflectedMessage - TODO(beng): move this to +// win_util.h! +#include "chrome/views/container_win.h" #include "webkit/glue/webcursor.h" namespace { diff --git a/chrome/browser/tab_contents.cc b/chrome/browser/tab_contents.cc index 2deb196..77a55f7 100644 --- a/chrome/browser/tab_contents.cc +++ b/chrome/browser/tab_contents.cc @@ -13,7 +13,7 @@ #include "chrome/common/l10n_util.h" #include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" -#include "chrome/views/hwnd_view_container.h" +#include "chrome/views/container.h" #include "chrome/views/native_scroll_bar.h" #include "chrome/views/root_view.h" #include "chrome/views/view.h" @@ -26,8 +26,8 @@ static size_t kMaxNumberOfConstrainedPopups = 20; namespace { BOOL CALLBACK InvalidateWindow(HWND hwnd, LPARAM lparam) { - // Note: erase is required to properly paint some widgets borders. This can be - // seen with textfields. + // Note: erase is required to properly paint some widgets borders. This can + // be seen with textfields. InvalidateRect(hwnd, NULL, TRUE); return TRUE; } @@ -365,7 +365,7 @@ void TabContents::StoreFocus() { if (container_hwnd) { ChromeViews::View* focused_view = focus_manager->GetFocusedView(); if (focused_view) { - HWND hwnd = focused_view->GetRootView()->GetViewContainer()->GetHWND(); + HWND hwnd = focused_view->GetRootView()->GetContainer()->GetHWND(); if (container_hwnd == hwnd || ::IsChild(container_hwnd, hwnd)) focus_manager->ClearFocus(); } diff --git a/chrome/browser/task_manager.cc b/chrome/browser/task_manager.cc index 82afafc..0f593b1 100644 --- a/chrome/browser/task_manager.cc +++ b/chrome/browser/task_manager.cc @@ -937,7 +937,7 @@ void TaskManagerContents::ShowContextMenu(ChromeViews::View* source, int y, bool is_mouse_gesture) { UpdateStatsCounters(); - Menu menu(this, Menu::TOPLEFT, source->GetViewContainer()->GetHWND()); + Menu menu(this, Menu::TOPLEFT, source->GetContainer()->GetHWND()); for (std::vector<ChromeViews::TableColumn>::iterator i = columns_.begin(); i != columns_.end(); ++i) { menu.AppendMenuItem(i->id, i->title, Menu::CHECKBOX); diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc index dce6d08..ca3267b 100644 --- a/chrome/browser/views/bookmark_bar_view.cc +++ b/chrome/browser/views/bookmark_bar_view.cc @@ -40,9 +40,9 @@ #include "chrome/common/resource_bundle.h" #include "chrome/common/win_util.h" #include "chrome/views/chrome_menu.h" +#include "chrome/views/container.h" #include "chrome/views/menu_button.h" #include "chrome/views/tooltip_manager.h" -#include "chrome/views/view_container.h" #include "chrome/views/window.h" #include "generated_resources.h" @@ -1408,7 +1408,7 @@ void BookmarkBarView::RunMenu(ChromeViews::View* view, gfx::Point screen_loc(x, 0); View::ConvertPointToScreen(this, &screen_loc); menu_runner_.reset(new MenuRunner(this, node, start_index)); - HWND parent_hwnd = GetViewContainer()->GetHWND(); + HWND parent_hwnd = GetContainer()->GetHWND(); menu_runner_->RunMenuAt(parent_hwnd, gfx::Rect(screen_loc.x(), screen_loc.y(), view->width(), bar_height), @@ -1433,7 +1433,7 @@ void BookmarkBarView::ButtonPressed(ChromeViews::BaseButton* sender) { PageTransition::AUTO_BOOKMARK); } else { BookmarkBarContextMenuController::OpenAll( - GetViewContainer()->GetHWND(), GetPageNavigator(), node, + GetContainer()->GetHWND(), GetPageNavigator(), node, event_utils::DispositionFromEventFlags(sender->mouse_event_flags())); } UserMetrics::RecordAction(L"ClickedBookmarkBarURLButton", profile_); @@ -1591,7 +1591,7 @@ void BookmarkBarView::ShowDropFolderForNode(BookmarkNode* node) { gfx::Point screen_loc; View::ConvertPointToScreen(view_to_position_menu_from, &screen_loc); drop_menu_runner_->RunMenuAt( - GetViewContainer()->GetHWND(), + GetContainer()->GetHWND(), gfx::Rect(screen_loc.x(), screen_loc.y(), view_to_position_menu_from->width(), view_to_position_menu_from->height()), @@ -1828,7 +1828,7 @@ void BookmarkBarView::StartThrobbing() { if (bubble_url_.is_empty()) return; // Bubble isn't showing; nothing to throb. - if (!GetViewContainer()) + if (!GetContainer()) return; // We're not showing, don't do anything. BookmarkNode* node = model_->GetMostRecentlyAddedNodeForURL(bubble_url_); diff --git a/chrome/browser/views/bookmark_bubble_view.cc b/chrome/browser/views/bookmark_bubble_view.cc index ffb9817..f6021ef 100644 --- a/chrome/browser/views/bookmark_bubble_view.cc +++ b/chrome/browser/views/bookmark_bubble_view.cc @@ -136,9 +136,9 @@ void BookmarkBubbleView::DidChangeBounds(const CRect& previous, } void BookmarkBubbleView::BubbleShown() { - DCHECK(GetViewContainer()); + DCHECK(GetContainer()); ChromeViews::FocusManager* focus_manager = - ChromeViews::FocusManager::GetFocusManager(GetViewContainer()->GetHWND()); + ChromeViews::FocusManager::GetFocusManager(GetContainer()->GetHWND()); focus_manager->RegisterAccelerator( ChromeViews::Accelerator(VK_RETURN, false, false, false), this); @@ -316,7 +316,7 @@ bool BookmarkBubbleView::CloseOnEscape() { } void BookmarkBubbleView::Close() { - static_cast<InfoBubble*>(GetViewContainer())->Close(); + static_cast<InfoBubble*>(GetContainer())->Close(); } void BookmarkBubbleView::RemoveBookmark() { @@ -342,16 +342,16 @@ void BookmarkBubbleView::ShowEditor() { // Parent the editor to our root ancestor (not the root we're in, as that // is the info bubble and will close shortly). - HWND parent = GetAncestor(GetViewContainer()->GetHWND(), GA_ROOTOWNER); + HWND parent = GetAncestor(GetContainer()->GetHWND(), GA_ROOTOWNER); // We're about to show the bookmark editor. When the bookmark editor closes - // we want the browser to become active. HWNDViewContainer::Hide() does a - // hide in a such way that activation isn't changed, which means when we - // close Windows gets confused as to who it should give active status to. - // We explicitly hide the bookmark bubble window in such a way that - // activation status changes. That way, when the editor closes, activation - // is properly restored to the browser. - ShowWindow(GetViewContainer()->GetHWND(), SW_HIDE); + // we want the browser to become active. ContainerWin::Hide() does a hide in + // a such way that activation isn't changed, which means when we close + // Windows gets confused as to who it should give active status to. We + // explicitly hide the bookmark bubble window in such a way that activation + // status changes. That way, when the editor closes, activation is properly + // restored to the browser. + ShowWindow(GetContainer()->GetHWND(), SW_HIDE); // Even though we just hid the window, we need to invoke Close to schedule // the delete and all that. diff --git a/chrome/browser/views/bookmark_editor_view.cc b/chrome/browser/views/bookmark_editor_view.cc index f73b4dd..b93e8a6 100644 --- a/chrome/browser/views/bookmark_editor_view.cc +++ b/chrome/browser/views/bookmark_editor_view.cc @@ -210,7 +210,7 @@ void BookmarkEditorView::ShowContextMenu(View* source, (tree_model_->GetParent(tree_view_.GetSelectedNode()) == tree_model_->GetRoot()); context_menu_.reset(new Menu(this, Menu::TOPLEFT, - GetViewContainer()->GetHWND())); + GetContainer()->GetHWND())); context_menu_->AppendMenuItemWithLabel(IDS_EDIT, l10n_util::GetString(IDS_EDIT)); context_menu_->AppendMenuItemWithLabel( diff --git a/chrome/browser/views/constrained_window_impl.cc b/chrome/browser/views/constrained_window_impl.cc index 4666e1f..11f635a 100644 --- a/chrome/browser/views/constrained_window_impl.cc +++ b/chrome/browser/views/constrained_window_impl.cc @@ -627,11 +627,10 @@ gfx::Size ConstrainedWindowNonClientView::GetPreferredSize() { void ConstrainedWindowNonClientView::ViewHierarchyChanged(bool is_add, View *parent, View *child) { - if (is_add && GetViewContainer()) { - // Add our Client View as we are added to the ViewContainer so that if we - // are subsequently resized all the parent-child relationships are - // established. - if (is_add && GetViewContainer() && child == this) + if (is_add && GetContainer()) { + // Add our Client View as we are added to the Container so that if we are + // subsequently resized all the parent-child relationships are established. + if (is_add && GetContainer() && child == this) AddChildView(container_->client_view()); if (location_bar_ && !location_bar_->IsInitialized()) location_bar_->Init(); @@ -1241,7 +1240,7 @@ void ConstrainedWindowImpl::UpdateUI(unsigned int changed_flags) { } //////////////////////////////////////////////////////////////////////////////// -// ConstrainedWindowImpl, ChromeViews::HWNDViewContainer overrides: +// ConstrainedWindowImpl, ChromeViews::ContainerWin overrides: void ConstrainedWindowImpl::OnDestroy() { // We do this here, rather than |Close|, since the window may be destroyed in @@ -1291,7 +1290,7 @@ void ConstrainedWindowImpl::OnFinalMessage(HWND window) { constrained_contents_ = NULL; } - HWNDViewContainer::OnFinalMessage(window); + ContainerWin::OnFinalMessage(window); } void ConstrainedWindowImpl::OnGetMinMaxInfo(LPMINMAXINFO mm_info) { diff --git a/chrome/browser/views/dom_view.cc b/chrome/browser/views/dom_view.cc index c97b605..24f6f5b 100644 --- a/chrome/browser/views/dom_view.cc +++ b/chrome/browser/views/dom_view.cc @@ -5,7 +5,7 @@ #include "chrome/browser/views/dom_view.h" #include "chrome/browser/dom_ui/dom_ui_host.h" -#include "chrome/views/hwnd_view_container.h" +#include "chrome/views/container.h" DOMView::DOMView(const GURL& contents) : contents_(contents), initialized_(false), host_(NULL) { @@ -29,7 +29,7 @@ bool DOMView::Init(Profile* profile, SiteInstance* instance) { // should only be associated with instances of DOMUIHost. TabContentsType type = TabContents::TypeForURL(&contents_); TabContents* tab_contents = TabContents::CreateWithType(type, - GetViewContainer()->GetHWND(), profile, instance); + GetContainer()->GetHWND(), profile, instance); host_ = tab_contents->AsDOMUIHost(); DCHECK(host_); diff --git a/chrome/browser/views/download_item_view.cc b/chrome/browser/views/download_item_view.cc index 1738463..66f4c55 100644 --- a/chrome/browser/views/download_item_view.cc +++ b/chrome/browser/views/download_item_view.cc @@ -16,9 +16,9 @@ #include "chrome/common/l10n_util.h" #include "chrome/common/resource_bundle.h" #include "chrome/common/win_util.h" +#include "chrome/views/container.h" #include "chrome/views/native_button.h" #include "chrome/views/root_view.h" -#include "chrome/views/view_container.h" #include "generated_resources.h" @@ -630,7 +630,7 @@ bool DownloadItemView::OnMousePressed(const ChromeViews::MouseEvent& event) { ChromeViews::View::ConvertPointToScreen(this, &point); download_util::DownloadShelfContextMenu menu(download_, - GetViewContainer()->GetHWND(), + GetContainer()->GetHWND(), model_.get(), point.ToPOINT()); drop_down_pressed_ = false; diff --git a/chrome/browser/views/download_started_animation.cc b/chrome/browser/views/download_started_animation.cc index f95b13c..d3e04c6 100644 --- a/chrome/browser/views/download_started_animation.cc +++ b/chrome/browser/views/download_started_animation.cc @@ -7,7 +7,7 @@ #include "chrome/app/theme/theme_resources.h" #include "chrome/browser/tab_contents.h" #include "chrome/common/resource_bundle.h" -#include "chrome/views/hwnd_view_container.h" +#include "chrome/views/container_win.h" // How long to spend moving downwards and fading out after waiting. static const int kMoveTimeMs = 600; @@ -44,7 +44,7 @@ DownloadStartedAnimation::DownloadStartedAnimation(TabContents* tab_contents) SetImage(kDownloadImage); gfx::Rect rc(0, 0, 0, 0); - popup_ = new ChromeViews::HWNDViewContainer; + popup_ = new ChromeViews::ContainerWin; popup_->set_window_style(WS_POPUP); popup_->set_window_ex_style(WS_EX_LAYERED | WS_EX_TOOLWINDOW | WS_EX_TRANSPARENT); diff --git a/chrome/browser/views/download_started_animation.h b/chrome/browser/views/download_started_animation.h index 5cff47fe..6934fc5 100644 --- a/chrome/browser/views/download_started_animation.h +++ b/chrome/browser/views/download_started_animation.h @@ -11,7 +11,7 @@ #include "chrome/views/image_view.h" namespace ChromeViews { - class HWNDViewContainer; +class ContainerWin; }; class TabContents; @@ -42,7 +42,7 @@ class DownloadStartedAnimation : public Animation, const NotificationDetails& details); // We use a HWND for the popup so that it may float above any HWNDs in our UI. - ChromeViews::HWNDViewContainer* popup_; + ChromeViews::ContainerWin* popup_; // The content area holding us. TabContents* tab_contents_; diff --git a/chrome/browser/views/download_tab_view.cc b/chrome/browser/views/download_tab_view.cc index 1deaf60..61f5164 100644 --- a/chrome/browser/views/download_tab_view.cc +++ b/chrome/browser/views/download_tab_view.cc @@ -702,7 +702,7 @@ bool DownloadItemTabView::OnMousePressed(const ChromeViews::MouseEvent& event) { ChromeViews::View::ConvertPointToScreen(this, &point); download_util::DownloadDestinationContextMenu menu( - model_, GetViewContainer()->GetHWND(), point.ToPOINT()); + model_, GetContainer()->GetHWND(), point.ToPOINT()); } } else { parent_->ItemBecameSelected(NULL); @@ -743,7 +743,7 @@ void DownloadItemTabView::LinkActivated(ChromeViews::Link* source, int event_flags) { // There are several links in our view that could have been clicked: if (source == file_name_) { - ChromeViews::ViewContainer* container = this->GetViewContainer(); + ChromeViews::Container* container = this->GetContainer(); HWND parent_window = container ? container->GetHWND() : NULL; model_->manager()->OpenDownloadInShell(model_, parent_window); } else if (source == pause_) { diff --git a/chrome/browser/views/frame/aero_glass_frame.cc b/chrome/browser/views/frame/aero_glass_frame.cc index cb86728..7810cac 100644 --- a/chrome/browser/views/frame/aero_glass_frame.cc +++ b/chrome/browser/views/frame/aero_glass_frame.cc @@ -91,7 +91,7 @@ ChromeViews::Window* AeroGlassFrame::GetWindow() { } /////////////////////////////////////////////////////////////////////////////// -// AeroGlassFrame, ChromeViews::HWNDViewContainer implementation: +// AeroGlassFrame, ChromeViews::ContainerWin implementation: void AeroGlassFrame::OnInitMenuPopup(HMENU menu, UINT position, BOOL is_system_menu) { @@ -183,7 +183,7 @@ LRESULT AeroGlassFrame::OnNCHitTest(const CPoint& pt) { } /////////////////////////////////////////////////////////////////////////////// -// AeroGlassFrame, ChromeViews::HWNDViewContainer overrides: +// AeroGlassFrame, ChromeViews::ContainerWin overrides: bool AeroGlassFrame::AcceleratorPressed( ChromeViews::Accelerator* accelerator) { diff --git a/chrome/browser/views/frame/aero_glass_frame.h b/chrome/browser/views/frame/aero_glass_frame.h index a649eef..ccdec53 100644 --- a/chrome/browser/views/frame/aero_glass_frame.h +++ b/chrome/browser/views/frame/aero_glass_frame.h @@ -38,13 +38,13 @@ class AeroGlassFrame : public BrowserFrame, virtual void UpdateThrobber(bool running); virtual ChromeViews::Window* GetWindow(); - // Overridden from ChromeViews::HWNDViewContainer: + // Overridden from ChromeViews::ContainerWin: virtual bool AcceleratorPressed(ChromeViews::Accelerator* accelerator); virtual bool GetAccelerator(int cmd_id, ChromeViews::Accelerator* accelerator); protected: - // Overridden from ChromeViews::HWNDViewContainer: + // Overridden from ChromeViews::ContainerWin: virtual void OnInitMenuPopup(HMENU menu, UINT position, BOOL is_system_menu); virtual void OnEndSession(BOOL ending, UINT logoff); virtual void OnExitMenuLoop(bool is_track_popup_menu); diff --git a/chrome/browser/views/frame/aero_glass_non_client_view.cc b/chrome/browser/views/frame/aero_glass_non_client_view.cc index 74de8bb..5155634 100644 --- a/chrome/browser/views/frame/aero_glass_non_client_view.cc +++ b/chrome/browser/views/frame/aero_glass_non_client_view.cc @@ -181,7 +181,7 @@ gfx::Size AeroGlassNonClientView::CalculateWindowSizeForClientSize( CPoint AeroGlassNonClientView::GetSystemMenuPoint() const { CPoint offset(0, 0); - MapWindowPoints(GetViewContainer()->GetHWND(), HWND_DESKTOP, &offset, 1); + MapWindowPoints(GetContainer()->GetHWND(), HWND_DESKTOP, &offset, 1); return offset; } @@ -259,7 +259,7 @@ void AeroGlassNonClientView::ViewHierarchyChanged(bool is_add, ChromeViews::View* parent, ChromeViews::View* child) { if (is_add && child == this) { - DCHECK(GetViewContainer()); + DCHECK(GetContainer()); DCHECK(frame_->client_view()->GetParent() != this); AddChildView(frame_->client_view()); } diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index 71b82c4..5a8b495 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -61,7 +61,7 @@ void BrowserView::Init() { toolbar_->Init(browser_->profile()); toolbar_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_TOOLBAR)); - status_bubble_.reset(new StatusBubble(GetViewContainer())); + status_bubble_.reset(new StatusBubble(GetContainer())); } void BrowserView::Show(int command, bool adjust_to_fit) { @@ -228,10 +228,10 @@ void BrowserView::DidChangeBounds(const CRect& previous, void BrowserView::ViewHierarchyChanged(bool is_add, ChromeViews::View* parent, ChromeViews::View* child) { - if (is_add && child == this && GetViewContainer() && !initialized_) { + if (is_add && child == this && GetContainer() && !initialized_) { Init(); // Make sure not to call Init() twice if we get inserted into a different - // ViewContainer. + // Container. initialized_ = true; } } diff --git a/chrome/browser/views/frame/browser_view2.cc b/chrome/browser/views/frame/browser_view2.cc index b5c4ee7..7ee9567 100644 --- a/chrome/browser/views/frame/browser_view2.cc +++ b/chrome/browser/views/frame/browser_view2.cc @@ -272,7 +272,7 @@ unsigned int BrowserView2::FeaturesForBrowserType(BrowserType::Type type) { void BrowserView2::Init() { // Stow a pointer to this object onto the window handle so that we can get // at it later when all we have is a HWND. - SetProp(GetViewContainer()->GetHWND(), kBrowserWindowKey, this); + SetProp(GetContainer()->GetHWND(), kBrowserWindowKey, this); LoadAccelerators(); SetAccessibleName(l10n_util::GetString(IDS_PRODUCT_NAME)); @@ -291,7 +291,7 @@ void BrowserView2::Init() { set_contents_view(contents_container_); AddChildView(contents_container_); - status_bubble_.reset(new StatusBubble(GetViewContainer())); + status_bubble_.reset(new StatusBubble(GetContainer())); #ifdef CHROME_PERSONALIZATION EnablePersonalization(CommandLine().HasSwitch(switches::kEnableP13n)); @@ -311,7 +311,7 @@ void BrowserView2::Close() { } void* BrowserView2::GetPlatformID() { - return GetViewContainer()->GetHWND(); + return GetContainer()->GetHWND(); } TabStrip* BrowserView2::GetTabStrip() const { @@ -356,7 +356,7 @@ void BrowserView2::FlashFrame() { void BrowserView2::ContinueDetachConstrainedWindowDrag( const gfx::Point& mouse_point, int frame_component) { - HWND vc_hwnd = GetViewContainer()->GetHWND(); + HWND vc_hwnd = GetContainer()->GetHWND(); if (frame_component == HTCLIENT) { // If the user's mouse was over the content area of the popup when they // clicked down, we need to re-play the mouse down event so as to actually @@ -789,7 +789,7 @@ void BrowserView2::DidChangeBounds(const CRect& previous, void BrowserView2::ViewHierarchyChanged(bool is_add, ChromeViews::View* parent, ChromeViews::View* child) { - if (is_add && child == this && GetViewContainer() && !initialized_) { + if (is_add && child == this && GetContainer() && !initialized_) { Init(); initialized_ = true; } @@ -1072,7 +1072,7 @@ void BrowserView2::LoadAccelerators() { CopyAcceleratorTable(accelerator_table, accelerators, count); ChromeViews::FocusManager* focus_manager = - ChromeViews::FocusManager::GetFocusManager(GetViewContainer()->GetHWND()); + ChromeViews::FocusManager::GetFocusManager(GetContainer()->GetHWND()); DCHECK(focus_manager); // Let's build our own accelerator table. diff --git a/chrome/browser/views/frame/opaque_frame.cc b/chrome/browser/views/frame/opaque_frame.cc index 97b9566..9bf52a3 100644 --- a/chrome/browser/views/frame/opaque_frame.cc +++ b/chrome/browser/views/frame/opaque_frame.cc @@ -63,7 +63,7 @@ void OpaqueFrame::UpdateWindowIcon() { } /////////////////////////////////////////////////////////////////////////////// -// OpaqueFrame, ChromeViews::HWNDViewContainer overrides: +// OpaqueFrame, ChromeViews::ContainerWin overrides: bool OpaqueFrame::AcceleratorPressed(ChromeViews::Accelerator* accelerator) { return browser_view_->AcceleratorPressed(*accelerator); diff --git a/chrome/browser/views/frame/opaque_frame.h b/chrome/browser/views/frame/opaque_frame.h index a30b855..f40f1a8 100644 --- a/chrome/browser/views/frame/opaque_frame.h +++ b/chrome/browser/views/frame/opaque_frame.h @@ -41,7 +41,7 @@ class OpaqueFrame : public BrowserFrame, // Overridden from ChromeViews::CustomFrameWindow: virtual void UpdateWindowIcon(); - // Overridden from ChromeViews::HWNDViewContainer: + // Overridden from ChromeViews::ContainerWin: virtual bool AcceleratorPressed(ChromeViews::Accelerator* accelerator); virtual bool GetAccelerator(int cmd_id, ChromeViews::Accelerator* accelerator); diff --git a/chrome/browser/views/frame/opaque_non_client_view.cc b/chrome/browser/views/frame/opaque_non_client_view.cc index 1bbbbfd..72b2215 100644 --- a/chrome/browser/views/frame/opaque_non_client_view.cc +++ b/chrome/browser/views/frame/opaque_non_client_view.cc @@ -660,7 +660,7 @@ void OpaqueNonClientView::ViewHierarchyChanged(bool is_add, ChromeViews::View* parent, ChromeViews::View* child) { if (is_add && child == this) { - DCHECK(GetViewContainer()); + DCHECK(GetContainer()); DCHECK(frame_->client_view()->GetParent() != this); AddChildView(frame_->client_view()); diff --git a/chrome/browser/views/hung_renderer_view.cc b/chrome/browser/views/hung_renderer_view.cc index edba957..bd0c289 100644 --- a/chrome/browser/views/hung_renderer_view.cc +++ b/chrome/browser/views/hung_renderer_view.cc @@ -321,7 +321,7 @@ void HungRendererWarningView::ButtonPressed( void HungRendererWarningView::ViewHierarchyChanged(bool is_add, ChromeViews::View* parent, ChromeViews::View* child) { - if (!initialized_ && is_add && child == this && GetViewContainer()) + if (!initialized_ && is_add && child == this && GetContainer()) Init(); } diff --git a/chrome/browser/views/hwnd_html_view.cc b/chrome/browser/views/hwnd_html_view.cc index 026ebe0..11a7225 100644 --- a/chrome/browser/views/hwnd_html_view.cc +++ b/chrome/browser/views/hwnd_html_view.cc @@ -8,7 +8,7 @@ #include "chrome/browser/render_widget_host_view_win.h" #include "chrome/browser/render_view_host_delegate.h" #include "chrome/browser/site_instance.h" -#include "chrome/views/view_container.h" +#include "chrome/views/container.h" HWNDHtmlView::~HWNDHtmlView() { if (render_view_host_) { @@ -47,6 +47,6 @@ void HWNDHtmlView::Init(HWND parent_hwnd) { void HWNDHtmlView::ViewHierarchyChanged(bool is_add, View* parent, View* child) { - if (is_add && GetViewContainer() && !initialized_) - Init(GetViewContainer()->GetHWND()); + if (is_add && GetContainer() && !initialized_) + Init(GetContainer()->GetHWND()); } diff --git a/chrome/browser/views/info_bar_item_view.cc b/chrome/browser/views/info_bar_item_view.cc index 1f1d2ab..b7c0d3b 100644 --- a/chrome/browser/views/info_bar_item_view.cc +++ b/chrome/browser/views/info_bar_item_view.cc @@ -7,10 +7,10 @@ #include "chrome/browser/views/standard_layout.h" #include "chrome/common/l10n_util.h" #include "chrome/common/resource_bundle.h" +#include "chrome/views/container.h" #include "chrome/views/external_focus_tracker.h" #include "chrome/views/image_view.h" #include "chrome/views/root_view.h" -#include "chrome/views/view_container.h" #include "generated_resources.h" @@ -203,7 +203,7 @@ void InfoBarItemView::ViewHierarchyChanged(bool is_add, View* root_view = GetRootView(); HWND root_hwnd = NULL; if (root_view) - root_hwnd = root_view->GetViewContainer()->GetHWND(); + root_hwnd = root_view->GetContainer()->GetHWND(); if (root_hwnd) { focus_tracker_.reset(new ChromeViews::ExternalFocusTracker( diff --git a/chrome/browser/views/info_bubble.cc b/chrome/browser/views/info_bubble.cc index 938ac49..d059af4 100644 --- a/chrome/browser/views/info_bubble.cc +++ b/chrome/browser/views/info_bubble.cc @@ -107,7 +107,7 @@ void InfoBubble::Init(HWND parent_hwnd, (win_util::GetWinVersion() < win_util::WINVERSION_XP) ? 0 : CS_DROPSHADOW); - HWNDViewContainer::Init(parent_hwnd, bounds, true); + ContainerWin::Init(parent_hwnd, bounds, true); SetContentsView(content_view_); // The preferred size may differ when parented. Ask for the bounds again // and if they differ reset the bounds. @@ -146,7 +146,7 @@ void InfoBubble::Close() { delegate_->InfoBubbleClosing(this); if (frame) frame->InfoBubbleClosing(); - HWNDViewContainer::Close(); + ContainerWin::Close(); } void InfoBubble::AnimationProgressed(const Animation* animation) { diff --git a/chrome/browser/views/info_bubble.h b/chrome/browser/views/info_bubble.h index e237660..bb8933b 100644 --- a/chrome/browser/views/info_bubble.h +++ b/chrome/browser/views/info_bubble.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_VIEWS_INFO_BUBBLE_H_ #include "chrome/common/slide_animation.h" -#include "chrome/views/hwnd_view_container.h" +#include "chrome/views/container_win.h" #include "chrome/views/view.h" // InfoBubble is used to display an arbitrary view above all other windows. @@ -30,7 +30,7 @@ class InfoBubbleDelegate { virtual bool CloseOnEscape() = 0; }; -class InfoBubble : public ChromeViews::HWNDViewContainer, +class InfoBubble : public ChromeViews::ContainerWin, public AnimationDelegate { public: // Shows the InfoBubble. The InfoBubble is parented to parent_hwnd, contains diff --git a/chrome/browser/views/keyword_editor_view.cc b/chrome/browser/views/keyword_editor_view.cc index fb1fd8e..a49801a 100644 --- a/chrome/browser/views/keyword_editor_view.cc +++ b/chrome/browser/views/keyword_editor_view.cc @@ -585,7 +585,7 @@ void KeywordEditorView::OnDoubleClick() { void KeywordEditorView::ButtonPressed(ChromeViews::NativeButton* sender) { if (sender == add_button_) { EditKeywordController* controller = - new EditKeywordController(GetViewContainer()->GetHWND(), NULL, this, + new EditKeywordController(GetContainer()->GetHWND(), NULL, this, profile_); controller->Show(); } else if (sender == remove_button_) { @@ -625,7 +625,7 @@ void KeywordEditorView::ButtonPressed(ChromeViews::NativeButton* sender) { const TemplateURL* template_url = &table_model_->GetTemplateURL(selected_row); EditKeywordController* controller = - new EditKeywordController(GetViewContainer()->GetHWND(), template_url, + new EditKeywordController(GetContainer()->GetHWND(), template_url, this, profile_); controller->Show(); } else if (sender == enable_suggest_checkbox_) { diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc index 8e3a2c5..51081bd 100644 --- a/chrome/browser/views/location_bar_view.cc +++ b/chrome/browser/views/location_bar_view.cc @@ -26,8 +26,8 @@ #include "chrome/common/win_util.h" #include "chrome/views/background.h" #include "chrome/views/border.h" +#include "chrome/views/container.h" #include "chrome/views/root_view.h" -#include "chrome/views/view_container.h" #include "generated_resources.h" using ChromeViews::View; @@ -123,7 +123,7 @@ void LocationBarView::Init() { } // URL edit field. - ChromeViews::ViewContainer* vc = GetViewContainer(); + ChromeViews::Container* vc = GetContainer(); DCHECK(vc) << "LocationBarView::Init - vc is NULL!"; location_entry_.reset(new AutocompleteEditView(font_, this, model_, this, vc->GetHWND(), @@ -843,7 +843,7 @@ void LocationBarView::ShowInfoBubbleTask::Run() { if (cancelled_) return; - if (!image_view_->GetViewContainer()->IsActive()) { + if (!image_view_->GetContainer()->IsActive()) { // The browser is no longer active. Let's not show the info bubble, this // would make the browser the active window again. Also makes sure we NULL // show_info_bubble_task_ to prevent the SecurityImageView from keeping a @@ -864,7 +864,7 @@ void LocationBarView::ShowInfoBubbleTask::Cancel() { void LocationBarView::ShowFirstRunBubbleInternal() { if (!location_entry_view_) return; - if (!location_entry_view_->GetViewContainer()->IsActive()) { + if (!location_entry_view_->GetContainer()->IsActive()) { // The browser is no longer active. Let's not show the info bubble, this // would make the browser the active window again. return; @@ -889,7 +889,7 @@ void LocationBarView::ShowFirstRunBubbleInternal() { bounds.set_x(location.x() - 20); FirstRunBubble::Show( - location_entry_view_->GetRootView()->GetViewContainer()->GetHWND(), + location_entry_view_->GetRootView()->GetContainer()->GetHWND(), bounds); } @@ -962,7 +962,7 @@ void LocationBarView::SecurityImageView::ShowInfoBubble() { label->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); label->SizeToFit(0); DCHECK(info_bubble_ == NULL); - info_bubble_ = InfoBubble::Show(GetRootView()->GetViewContainer()->GetHWND(), + info_bubble_ = InfoBubble::Show(GetRootView()->GetContainer()->GetHWND(), bounds, label, this); show_info_bubble_task_ = NULL; } @@ -1006,7 +1006,7 @@ bool LocationBarView::SecurityImageView::OnMousePressed( } PageInfoWindow::CreatePageInfo(profile_, nav_entry, - GetRootView()->GetViewContainer()->GetHWND(), + GetRootView()->GetContainer()->GetHWND(), PageInfoWindow::SECURITY); return true; } diff --git a/chrome/browser/views/old_frames/vista_frame.cc b/chrome/browser/views/old_frames/vista_frame.cc index fb934ad..fe1f0b4 100644 --- a/chrome/browser/views/old_frames/vista_frame.cc +++ b/chrome/browser/views/old_frames/vista_frame.cc @@ -38,7 +38,6 @@ #include "chrome/views/aero_tooltip_manager.h" #include "chrome/views/background.h" #include "chrome/views/event.h" -#include "chrome/views/hwnd_view_container.h" #include "chrome/views/hwnd_notification_source.h" #include "chromium_strings.h" @@ -468,7 +467,7 @@ void VistaFrame::Init() { FrameUtil::LoadAccelerators(this, accelerators_table, this); ShelfVisibilityChanged(); - root_view_.OnViewContainerCreated(); + root_view_.OnContainerCreated(); Layout(); } @@ -522,7 +521,7 @@ void VistaFrame::Close() { browser_->OnWindowClosing(); } else { // Empty tab strip, it's now safe to clean-up. - root_view_.OnViewContainerDestroyed(); + root_view_.OnContainerDestroyed(); NotificationService::current()->Notify( NOTIFY_WINDOW_CLOSED, Source<HWND>(m_hWnd), @@ -588,7 +587,7 @@ gfx::Rect VistaFrame::GetBoundsForContentBounds(const gfx::Rect content_rect) { } gfx::Point p; - ChromeViews::View::ConvertPointToViewContainer(tab_contents_container_, &p); + ChromeViews::View::ConvertPointToContainer(tab_contents_container_, &p); CRect bounds; GetBounds(&bounds, true); @@ -1173,7 +1172,7 @@ void VistaFrame::ProcessMouseExited() { //////////////////////////////////////////////////////////////////////////////// // -// ChromeViews::ViewContainer +// ChromeViews::Container // //////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/views/old_frames/vista_frame.h b/chrome/browser/views/old_frames/vista_frame.h index b812db1..5858436 100644 --- a/chrome/browser/views/old_frames/vista_frame.h +++ b/chrome/browser/views/old_frames/vista_frame.h @@ -16,7 +16,7 @@ #include "chrome/browser/browser_window.h" #include "chrome/browser/views/old_frames/frame_view.h" #include "chrome/browser/views/status_bubble.h" -#include "chrome/views/view_container.h" +#include "chrome/views/container.h" #include "chrome/views/root_view.h" #include "chrome/views/hwnd_view.h" #include "chrome/views/image_view.h" @@ -44,7 +44,7 @@ class VistaFrame : public BrowserWindow, CWindow, CWinTraits<WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN>>, - public ChromeViews::ViewContainer, + public ChromeViews::Container, public ChromeViews::AcceleratorTarget { public: // Create a new VistaFrame given the bounds and provided browser. @@ -187,7 +187,7 @@ class VistaFrame : public BrowserWindow, virtual bool IsBookmarkBarVisible() const; //////////////////////////////////////////////////////////////////////////////// - // ChromeViews::ViewContainer + // ChromeViews::Container //////////////////////////////////////////////////////////////////////////////// virtual void GetBounds(CRect *out, bool including_frame) const; diff --git a/chrome/browser/views/old_frames/xp_frame.cc b/chrome/browser/views/old_frames/xp_frame.cc index 2512f63..24f614d 100644 --- a/chrome/browser/views/old_frames/xp_frame.cc +++ b/chrome/browser/views/old_frames/xp_frame.cc @@ -37,7 +37,6 @@ #include "chrome/views/background.h" #include "chrome/views/event.h" #include "chrome/views/focus_manager.h" -#include "chrome/views/hwnd_view_container.h" #include "chrome/views/hwnd_notification_source.h" #include "chrome/views/tooltip_manager.h" #include "chrome/views/view.h" @@ -540,7 +539,7 @@ void XPFrame::Init() { FrameUtil::LoadAccelerators(this, accelerators_table, this); ShelfVisibilityChanged(); - root_view_.OnViewContainerCreated(); + root_view_.OnContainerCreated(); } TabStrip* XPFrame::CreateTabStrip(Browser* browser) { @@ -879,7 +878,7 @@ void XPFrame::Close() { } else { // Empty tab strip, it's now safe to do the final clean-up. - root_view_.OnViewContainerDestroyed(); + root_view_.OnContainerDestroyed(); NotificationService::current()->Notify( NOTIFY_WINDOW_CLOSED, Source<HWND>(m_hWnd), @@ -1794,7 +1793,7 @@ void XPFrame::SetResizeCursor(ResizeMode r_mode) { //////////////////////////////////////////////////////////////////////////////// // -// ViewContainer +// Container // //////////////////////////////////////////////////////////////////////////////// @@ -1814,7 +1813,7 @@ gfx::Rect XPFrame::GetBoundsForContentBounds(const gfx::Rect content_rect) { } gfx::Point p; - ChromeViews::View::ConvertPointToViewContainer(tab_contents_container_, &p); + ChromeViews::View::ConvertPointToContainer(tab_contents_container_, &p); CRect bounds; GetBounds(&bounds, true); diff --git a/chrome/browser/views/old_frames/xp_frame.h b/chrome/browser/views/old_frames/xp_frame.h index 89df94c..b0bb8c9 100644 --- a/chrome/browser/views/old_frames/xp_frame.h +++ b/chrome/browser/views/old_frames/xp_frame.h @@ -16,8 +16,8 @@ #include "chrome/browser/browser_window.h" #include "chrome/browser/views/old_frames/frame_view.h" #include "chrome/browser/views/status_bubble.h" -#include "chrome/views/view_container.h" #include "chrome/views/button.h" +#include "chrome/views/container.h" #include "chrome/views/hwnd_view.h" #include "chrome/views/root_view.h" #include "chrome/views/image_view.h" @@ -52,7 +52,7 @@ class XPFrame : public BrowserWindow, WS_MAXIMIZEBOX | WS_CLIPCHILDREN>>, public ChromeViews::BaseButton::ButtonListener, - public ChromeViews::ViewContainer, + public ChromeViews::Container, public ChromeViews::AcceleratorTarget { public: @@ -156,7 +156,7 @@ class XPFrame : public BrowserWindow, void ButtonPressed(ChromeViews::BaseButton *sender); // - // ViewContainer + // Container virtual void GetBounds(CRect *out, bool including_frame) const; virtual void MoveToFront(bool should_activate); virtual HWND GetHWND() const; diff --git a/chrome/browser/views/options/advanced_contents_view.cc b/chrome/browser/views/options/advanced_contents_view.cc index 0c04dd8..7df768c 100644 --- a/chrome/browser/views/options/advanced_contents_view.cc +++ b/chrome/browser/views/options/advanced_contents_view.cc @@ -505,7 +505,7 @@ void ContentSection::ButtonPressed(ChromeViews::NativeButton* sender) { disable_popup_blocked_notification_pref_.SetValue(!notification_disabled); } else if (sender == gears_settings_button_) { UserMetricsRecordAction(L"Options_GearsSettings", NULL); - GearsSettingsPressed(GetAncestor(GetViewContainer()->GetHWND(), GA_ROOT)); + GearsSettingsPressed(GetAncestor(GetContainer()->GetHWND(), GA_ROOT)); } } diff --git a/chrome/browser/views/options/content_page_view.cc b/chrome/browser/views/options/content_page_view.cc index 510976a..52911a4 100644 --- a/chrome/browser/views/options/content_page_view.cc +++ b/chrome/browser/views/options/content_page_view.cc @@ -25,11 +25,11 @@ #include "chrome/common/pref_service.h" #include "chrome/common/resource_bundle.h" #include "chrome/views/checkbox.h" +#include "chrome/views/container.h" #include "chrome/views/grid_layout.h" #include "chrome/views/native_button.h" #include "chrome/views/radio_button.h" #include "chrome/views/text_field.h" -#include "chrome/views/view_container.h" #include "generated_resources.h" #include "skia/include/SkBitmap.h" @@ -127,7 +127,7 @@ gfx::Size FileDisplayArea::GetPreferredSize() { void FileDisplayArea::ViewHierarchyChanged(bool is_add, ChromeViews::View* parent, ChromeViews::View* child) { - if (!initialized_ && is_add && GetViewContainer()) + if (!initialized_ && is_add && GetContainer()) Init(); } diff --git a/chrome/browser/views/options/fonts_languages_window_view.cc b/chrome/browser/views/options/fonts_languages_window_view.cc index a93fe2c..b147d4e 100644 --- a/chrome/browser/views/options/fonts_languages_window_view.cc +++ b/chrome/browser/views/options/fonts_languages_window_view.cc @@ -75,7 +75,7 @@ gfx::Size FontsLanguagesWindowView::GetPreferredSize() { void FontsLanguagesWindowView::ViewHierarchyChanged( bool is_add, ChromeViews::View* parent, ChromeViews::View* child) { - // Can't init before we're inserted into a ViewContainer, because we require + // Can't init before we're inserted into a Container, because we require // a HWND to parent native child controls to. if (is_add && child == this) Init(); diff --git a/chrome/browser/views/options/fonts_page_view.cc b/chrome/browser/views/options/fonts_page_view.cc index 0dd8bab..7bd8836 100644 --- a/chrome/browser/views/options/fonts_page_view.cc +++ b/chrome/browser/views/options/fonts_page_view.cc @@ -26,11 +26,11 @@ #include "chrome/common/pref_service.h" #include "chrome/common/resource_bundle.h" #include "chrome/views/checkbox.h" +#include "chrome/views/container.h" #include "chrome/views/grid_layout.h" #include "chrome/views/native_button.h" #include "chrome/views/radio_button.h" #include "chrome/views/text_field.h" -#include "chrome/views/view_container.h" #include "generated_resources.h" #include "skia/include/SkBitmap.h" @@ -228,7 +228,7 @@ FontsPageView::~FontsPageView() { } void FontsPageView::ButtonPressed(ChromeViews::NativeButton* sender) { - HWND owning_hwnd = GetAncestor(GetViewContainer()->GetHWND(), GA_ROOT); + HWND owning_hwnd = GetAncestor(GetContainer()->GetHWND(), GA_ROOT); std::wstring font_name; int font_size = 0; if (sender == serif_font_change_page_button_) { diff --git a/chrome/browser/views/options/languages_page_view.cc b/chrome/browser/views/options/languages_page_view.cc index 9a22c74..240bbe3 100644 --- a/chrome/browser/views/options/languages_page_view.cc +++ b/chrome/browser/views/options/languages_page_view.cc @@ -28,12 +28,12 @@ #include "chrome/common/resource_bundle.h" #include "chrome/views/checkbox.h" #include "chrome/views/combo_box.h" +#include "chrome/views/container.h" #include "chrome/views/grid_layout.h" #include "chrome/views/native_button.h" #include "chrome/views/radio_button.h" #include "chrome/views/tabbed_pane.h" #include "chrome/views/text_field.h" -#include "chrome/views/view_container.h" #include "skia/include/SkBitmap.h" #include "unicode/uloc.h" @@ -305,7 +305,7 @@ gfx::Size AddLanguageWindowView::GetPreferredSize() { void AddLanguageWindowView::ViewHierarchyChanged( bool is_add, ChromeViews::View* parent, ChromeViews::View* child) { - // Can't init before we're inserted into a ViewContainer, because we require + // Can't init before we're inserted into a Container, because we require // a HWND to parent native child controls to. if (is_add && child == this) Init(); @@ -503,7 +503,7 @@ void LanguagesPageView::ButtonPressed(ChromeViews::NativeButton* sender) { language_table_edited_ = true; } else if (sender == add_button_) { ChromeViews::Window::CreateChromeWindow( - GetViewContainer()->GetHWND(), + GetContainer()->GetHWND(), gfx::Rect(), new AddLanguageWindowView(this, profile()))->Show(); language_table_edited_ = true; diff --git a/chrome/browser/views/options/options_page_view.cc b/chrome/browser/views/options/options_page_view.cc index d6ea955..5672397 100644 --- a/chrome/browser/views/options/options_page_view.cc +++ b/chrome/browser/views/options/options_page_view.cc @@ -7,7 +7,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/user_metrics.h" #include "chrome/common/pref_service.h" -#include "chrome/views/view_container.h" +#include "chrome/views/container.h" /////////////////////////////////////////////////////////////////////////////// // OptionsPageView @@ -43,7 +43,7 @@ void OptionsPageView::Observe(NotificationType type, void OptionsPageView::ViewHierarchyChanged(bool is_add, ChromeViews::View* parent, ChromeViews::View* child) { - if (!initialized_ && is_add && GetViewContainer()) { + if (!initialized_ && is_add && GetContainer()) { // It is important that this only get done _once_ otherwise we end up // duplicating the view hierarchy when tabs are switched. initialized_ = true; @@ -53,7 +53,7 @@ void OptionsPageView::ViewHierarchyChanged(bool is_add, } HWND OptionsPageView::GetRootWindow() const { - // Our ViewContainer is the TabbedPane content HWND, which is a child HWND. + // Our Container is the TabbedPane content HWND, which is a child HWND. // We need the root HWND for parenting. - return GetAncestor(GetViewContainer()->GetHWND(), GA_ROOT); + return GetAncestor(GetContainer()->GetHWND(), GA_ROOT); } diff --git a/chrome/browser/views/options/options_window_view.cc b/chrome/browser/views/options/options_window_view.cc index 57138f0..4393a7e 100644 --- a/chrome/browser/views/options/options_window_view.cc +++ b/chrome/browser/views/options/options_window_view.cc @@ -172,8 +172,8 @@ gfx::Size OptionsWindowView::GetPreferredSize() { void OptionsWindowView::ViewHierarchyChanged(bool is_add, ChromeViews::View* parent, ChromeViews::View* child) { - // Can't init before we're inserted into a ViewContainer, because we require - // a HWND to parent native child controls to. + // Can't init before we're inserted into a Container, because we require a + // HWND to parent native child controls to. if (is_add && child == this) Init(); } diff --git a/chrome/browser/views/sad_tab_view.h b/chrome/browser/views/sad_tab_view.h index f4ca7f0..2486224 100644 --- a/chrome/browser/views/sad_tab_view.h +++ b/chrome/browser/views/sad_tab_view.h @@ -15,11 +15,11 @@ // A ChromeViews::View subclass used to render the presentation of the crashed // "sad tab" in the browser window when a renderer is destroyed unnaturally. // -// Note that since this view is not (currently) part of a ViewContainer or +// Note that since this view is not (currently) part of a Container or // RootView hierarchy, it cannot respond to events or contain controls that -// do, right now it is used simply to render. Adding an extra ViewContainer to +// do, right now it is used simply to render. Adding an extra Container to // WebContents seemed like a lot of complexity. Ideally, perhaps WebContents' -// view portion would itself become a ViewContainer in the future, then event +// view portion would itself become a Container in the future, then event // processing will work. // /////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/views/shelf_item_dialog.cc b/chrome/browser/views/shelf_item_dialog.cc index f1bbeaa..306922f 100644 --- a/chrome/browser/views/shelf_item_dialog.cc +++ b/chrome/browser/views/shelf_item_dialog.cc @@ -458,7 +458,7 @@ bool ShelfItemDialog::AcceleratorPressed( window()->Close(); } else if (accelerator.GetKeyCode() == VK_RETURN) { ChromeViews::FocusManager* fm = ChromeViews::FocusManager::GetFocusManager( - GetViewContainer()->GetHWND()); + GetContainer()->GetHWND()); if (fm->GetFocusedView() == url_table_) { // Return on table behaves like a double click. OnDoubleClick(); diff --git a/chrome/browser/views/status_bubble.cc b/chrome/browser/views/status_bubble.cc index 9021634..fab001c 100644 --- a/chrome/browser/views/status_bubble.cc +++ b/chrome/browser/views/status_bubble.cc @@ -14,10 +14,9 @@ #include "chrome/common/gfx/url_elider.h" #include "chrome/common/l10n_util.h" #include "chrome/common/resource_bundle.h" -#include "chrome/views/hwnd_view_container.h" #include "chrome/views/label.h" #include "chrome/views/root_view.h" -#include "chrome/views/view_container.h" +#include "chrome/views/container_win.h" #include "googleurl/src/gurl.h" #include "net/base/net_util.h" #include "SkPaint.h" @@ -69,8 +68,7 @@ class StatusBubble::StatusView : public ChromeViews::Label, public Animation, public AnimationDelegate { public: - StatusView(StatusBubble* status_bubble, - ChromeViews::HWNDViewContainer* popup) + StatusView(StatusBubble* status_bubble, ChromeViews::ContainerWin* popup) : Animation(kFramerate, this), status_bubble_(status_bubble), popup_(popup), @@ -154,7 +152,7 @@ class StatusBubble::StatusView : public ChromeViews::Label, StatusBubble* status_bubble_; // Handle to the HWND that contains us. - ChromeViews::HWNDViewContainer* popup_; + ChromeViews::ContainerWin* popup_; // The currently-displayed text. std::wstring text_; @@ -445,7 +443,7 @@ void StatusBubble::StatusView::Paint(ChromeCanvas* canvas) { // StatusBubble --------------------------------------------------------------- -StatusBubble::StatusBubble(ChromeViews::ViewContainer* frame) +StatusBubble::StatusBubble(ChromeViews::Container* frame) : popup_(NULL), frame_(frame), view_(NULL), @@ -467,7 +465,7 @@ StatusBubble::~StatusBubble() { void StatusBubble::Init() { if (!popup_) { - popup_ = new ChromeViews::HWNDViewContainer(); + popup_ = new ChromeViews::ContainerWin(); popup_->set_delete_on_destroy(false); if (!view_) { diff --git a/chrome/browser/views/status_bubble.h b/chrome/browser/views/status_bubble.h index c6083f1..28d189c 100644 --- a/chrome/browser/views/status_bubble.h +++ b/chrome/browser/views/status_bubble.h @@ -6,8 +6,8 @@ #define CHROME_BROWSER_VIEWS_STATUS_BUBBLE_H__ #include "base/gfx/rect.h" -#include "chrome/views/hwnd_view_container.h" -#include "chrome/views/view_container.h" +#include "chrome/views/container.h" +#include "chrome/views/container_win.h" class GURL; @@ -16,7 +16,7 @@ class GURL; // to allow users to see where hovered links point to. class StatusBubble { public: - explicit StatusBubble(ChromeViews::ViewContainer* frame); + explicit StatusBubble(ChromeViews::Container* frame); ~StatusBubble(); // Sets the bubble contents to a specific string and causes the bubble @@ -74,10 +74,10 @@ class StatusBubble { // We use a HWND for the popup so that it may float above any HWNDs in our // UI (the location bar, for example). - ChromeViews::HWNDViewContainer* popup_; + ChromeViews::ContainerWin* popup_; double opacity_; - ChromeViews::ViewContainer* frame_; + ChromeViews::Container* frame_; StatusView* view_; DISALLOW_EVIL_CONSTRUCTORS(StatusBubble); diff --git a/chrome/browser/views/tab_contents_container_view.cc b/chrome/browser/views/tab_contents_container_view.cc index 0918ccf..a8ed55a 100644 --- a/chrome/browser/views/tab_contents_container_view.cc +++ b/chrome/browser/views/tab_contents_container_view.cc @@ -13,7 +13,7 @@ #include "chrome/browser/tab_contents.h" #include "chrome/browser/view_ids.h" #include "chrome/browser/web_contents.h" -#include "chrome/views/hwnd_view_container.h" +#include "chrome/views/container.h" #include "chrome/views/root_view.h" using ChromeViews::FocusTraversable; @@ -229,8 +229,7 @@ void TabContentsContainerView::RenderViewHostChanged(RenderViewHost* old_host, // If we are focused, we need to pass the focus to the new RenderViewHost. FocusManager* focus_manager = - FocusManager::GetFocusManager(GetRootView()->GetViewContainer()-> - GetHWND()); + FocusManager::GetFocusManager(GetRootView()->GetContainer()->GetHWND()); if (focus_manager->GetFocusedView() == this) Focus(); } diff --git a/chrome/browser/views/tabs/dragged_tab_controller.cc b/chrome/browser/views/tabs/dragged_tab_controller.cc index bb93238..b174dc8 100644 --- a/chrome/browser/views/tabs/dragged_tab_controller.cc +++ b/chrome/browser/views/tabs/dragged_tab_controller.cc @@ -273,8 +273,7 @@ void DraggedTabController::DidProcessMessage(const MSG& msg) { void DraggedTabController::InitWindowCreatePoint() { window_create_point_.SetPoint(mouse_offset_.x(), mouse_offset_.y()); Tab* first_tab = attached_tabstrip_->GetTabAt(0); - ChromeViews::View::ConvertPointToViewContainer(first_tab, - &window_create_point_); + ChromeViews::View::ConvertPointToContainer(first_tab, &window_create_point_); } gfx::Point DraggedTabController::GetWindowCreatePoint() const { @@ -386,7 +385,7 @@ void DraggedTabController::MoveTab(const gfx::Point& screen_point) { TabStrip* DraggedTabController::GetTabStripForPoint( const gfx::Point& screen_point) const { - HWND dragged_hwnd = view_->GetViewContainer()->GetHWND(); + HWND dragged_hwnd = view_->GetContainer()->GetHWND(); HWND other_hwnd = WindowFinder::WindowForPoint(screen_point, dragged_hwnd); if (!other_hwnd) return NULL; @@ -487,7 +486,7 @@ void DraggedTabController::Attach(TabStrip* attached_tabstrip, tab->SetVisible(false); // Move the corresponding window to the front. - attached_tabstrip_->GetViewContainer()->MoveToFront(true); + attached_tabstrip_->GetContainer()->MoveToFront(true); } void DraggedTabController::Detach() { @@ -679,7 +678,7 @@ void DraggedTabController::RevertDrag() { // it has been hidden. if (restore_frame) { if (!restore_bounds_.IsEmpty()) { - HWND frame_hwnd = source_tabstrip_->GetViewContainer()->GetHWND(); + HWND frame_hwnd = source_tabstrip_->GetContainer()->GetHWND(); MoveWindow(frame_hwnd, restore_bounds_.x(), restore_bounds_.y(), restore_bounds_.width(), restore_bounds_.height(), TRUE); } @@ -747,7 +746,7 @@ int DraggedTabController::NormalizeIndexToAttachedTabStrip(int index) const { void DraggedTabController::HideFrame() { // We don't actually hide the window, rather we just move it way off-screen. // If we actually hide it, we stop receiving drag events. - HWND frame_hwnd = source_tabstrip_->GetViewContainer()->GetHWND(); + HWND frame_hwnd = source_tabstrip_->GetContainer()->GetHWND(); RECT wr; GetWindowRect(frame_hwnd, &wr); MoveWindow(frame_hwnd, 0xFFFF, 0xFFFF, wr.right - wr.left, diff --git a/chrome/browser/views/tabs/dragged_tab_view.cc b/chrome/browser/views/tabs/dragged_tab_view.cc index 5b43500..2c326ba 100644 --- a/chrome/browser/views/tabs/dragged_tab_view.cc +++ b/chrome/browser/views/tabs/dragged_tab_view.cc @@ -9,7 +9,7 @@ #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/views/tabs/hwnd_photobooth.h" #include "chrome/browser/views/tabs/tab_renderer.h" -#include "chrome/views/hwnd_view_container.h" +#include "chrome/views/container_win.h" #include "skia/include/SkShader.h" const int kTransparentAlpha = 200; @@ -38,7 +38,7 @@ DraggedTabView::DraggedTabView(TabContents* datasource, renderer_->UpdateData(datasource); - container_ = new ChromeViews::HWNDViewContainer; + container_ = new ChromeViews::ContainerWin; container_->set_window_style(WS_POPUP); container_->set_window_ex_style( WS_EX_LAYERED | WS_EX_TOPMOST | WS_EX_TOOLWINDOW); @@ -106,7 +106,7 @@ void DraggedTabView::AnimateToBounds(const gfx::Rect& bounds, animation_callback_.reset(callback); RECT wr; - GetWindowRect(GetViewContainer()->GetHWND(), &wr); + GetWindowRect(GetContainer()->GetHWND(), &wr); animation_start_bounds_ = wr; animation_end_bounds_ = bounds; diff --git a/chrome/browser/views/tabs/dragged_tab_view.h b/chrome/browser/views/tabs/dragged_tab_view.h index 14ba7ec..0f4d626 100644 --- a/chrome/browser/views/tabs/dragged_tab_view.h +++ b/chrome/browser/views/tabs/dragged_tab_view.h @@ -13,7 +13,7 @@ #include "skia/include/SkBitmap.h" namespace ChromeViews { -class HWNDViewContainer; +class ContainerWin; } namespace gfx { class Point; @@ -76,7 +76,7 @@ class DraggedTabView : public ChromeViews::View, int ScaleValue(int value); // The window that contains the DraggedTabView. - ChromeViews::HWNDViewContainer* container_; + ChromeViews::ContainerWin* container_; // The renderer that paints the Tab shape. scoped_ptr<TabRenderer> renderer_; diff --git a/chrome/browser/views/tabs/hwnd_photobooth.cc b/chrome/browser/views/tabs/hwnd_photobooth.cc index a230c6b..5096565 100644 --- a/chrome/browser/views/tabs/hwnd_photobooth.cc +++ b/chrome/browser/views/tabs/hwnd_photobooth.cc @@ -6,7 +6,7 @@ #include "chrome/browser/tab_contents.h" #include "chrome/browser/views/tabs/hwnd_photobooth.h" #include "chrome/common/gfx/chrome_canvas.h" -#include "chrome/views/hwnd_view_container.h" +#include "chrome/views/container_win.h" #include "skia/include/SkBitmap.h" namespace { @@ -143,7 +143,7 @@ void HWNDPhotobooth::CreateCaptureWindow(HWND initial_hwnd) { gfx::Point window_position = GetCaptureWindowPosition(); gfx::Rect capture_bounds(window_position.x(), window_position.y(), contents_rect.Width(), contents_rect.Height()); - capture_window_ = new ChromeViews::HWNDViewContainer; + capture_window_ = new ChromeViews::ContainerWin; capture_window_->set_window_style(WS_POPUP); // WS_EX_TOOLWINDOW ensures the capture window doesn't produce a Taskbar // button. diff --git a/chrome/browser/views/tabs/hwnd_photobooth.h b/chrome/browser/views/tabs/hwnd_photobooth.h index 4de1d14..d3f79bb 100644 --- a/chrome/browser/views/tabs/hwnd_photobooth.h +++ b/chrome/browser/views/tabs/hwnd_photobooth.h @@ -10,7 +10,7 @@ class ChromeCanvas; namespace ChromeViews { -class HWNDViewContainer; +class ContainerWin; } /////////////////////////////////////////////////////////////////////////////// @@ -50,7 +50,7 @@ class HWNDPhotobooth { void CreateCaptureWindow(HWND initial_hwnd); // The nearly off-screen photo-booth layered window used to hold the HWND. - ChromeViews::HWNDViewContainer* capture_window_; + ChromeViews::ContainerWin* capture_window_; // The current HWND being captured. HWND current_hwnd_; diff --git a/chrome/browser/views/tabs/tab.cc b/chrome/browser/views/tabs/tab.cc index 8a6f205..a64a073 100644 --- a/chrome/browser/views/tabs/tab.cc +++ b/chrome/browser/views/tabs/tab.cc @@ -5,12 +5,12 @@ #include "chrome/browser/views/tabs/tab.h" #include "base/gfx/size.h" -#include "chrome/views/view_container.h" #include "chrome/common/gfx/chrome_canvas.h" #include "chrome/common/gfx/path.h" #include "chrome/common/l10n_util.h" #include "chrome/common/resource_bundle.h" #include "chrome/views/chrome_menu.h" +#include "chrome/views/container.h" #include "chrome/views/tooltip_manager.h" #include "generated_resources.h" @@ -53,9 +53,8 @@ class TabContextMenuController : public ChromeViews::MenuDelegate { } void RunMenuAt(int x, int y) { - menu_->RunMenuAt(tab_->GetViewContainer()->GetHWND(), - gfx::Rect(x, y, 0, 0), ChromeViews::MenuItemView::TOPLEFT, - true); + menu_->RunMenuAt(tab_->GetContainer()->GetHWND(), gfx::Rect(x, y, 0, 0), + ChromeViews::MenuItemView::TOPLEFT, true); } private: diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc index 7158bf0..c4e1371 100644 --- a/chrome/browser/views/tabs/tab_strip.cc +++ b/chrome/browser/views/tabs/tab_strip.cc @@ -342,10 +342,9 @@ class RemoveTabAnimation : public TabStrip::TabAnimation { } } - // When the animation completes, we send the ViewContainer a message to - // simulate a mouse moved event at the current mouse position. This tickles - // the Tab the mouse is currently over to show the "hot" state of the close - // button. + // When the animation completes, we send the Container a message to simulate + // a mouse moved event at the current mouse position. This tickles the Tab + // the mouse is currently over to show the "hot" state of the close button. void HighlightCloseButton() { if (tabstrip_->available_width_for_tabs_ == -1 || tabstrip_->IsDragSessionActive()) { @@ -356,7 +355,7 @@ class RemoveTabAnimation : public TabStrip::TabAnimation { POINT pt; GetCursorPos(&pt); - ChromeViews::ViewContainer* vc = tabstrip_->GetViewContainer(); + ChromeViews::Container* vc = tabstrip_->GetContainer(); RECT wr; GetWindowRect(vc->GetHWND(), &wr); pt.x -= wr.left; @@ -837,7 +836,7 @@ void TabStrip::TabInsertedAt(TabContents* contents, // Don't animate the first tab, it looks weird, and don't animate anything // if the containing window isn't visible yet. - if (GetTabCount() > 1 && IsWindowVisible(GetViewContainer()->GetHWND())) { + if (GetTabCount() > 1 && IsWindowVisible(GetContainer()->GetHWND())) { StartInsertTabAnimation(index); } else { Layout(); @@ -1402,7 +1401,7 @@ TabStrip::DropInfo::DropInfo(int drop_index, bool drop_before, bool point_down) : drop_index(drop_index), drop_before(drop_before), point_down(point_down) { - arrow_window = new ChromeViews::HWNDViewContainer(); + arrow_window = new ChromeViews::ContainerWin(); arrow_window->set_window_style(WS_POPUP); arrow_window->set_window_ex_style(WS_EX_TOPMOST | WS_EX_NOACTIVATE | WS_EX_LAYERED | WS_EX_TRANSPARENT); diff --git a/chrome/browser/views/tabs/tab_strip.h b/chrome/browser/views/tabs/tab_strip.h index f30f59b..b00268db 100644 --- a/chrome/browser/views/tabs/tab_strip.h +++ b/chrome/browser/views/tabs/tab_strip.h @@ -9,7 +9,7 @@ #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/views/tabs/tab.h" #include "chrome/views/button.h" -#include "chrome/views/hwnd_view_container.h" +#include "chrome/views/container_win.h" #include "chrome/views/menu.h" #include "chrome/views/view.h" @@ -342,7 +342,7 @@ class TabStrip : public ChromeViews::View, bool point_down; // Renders the drop indicator. - ChromeViews::HWNDViewContainer* arrow_window; + ChromeViews::ContainerWin* arrow_window; ChromeViews::ImageView* arrow_view; private: diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc index 63dd222..45d4354 100644 --- a/chrome/browser/views/toolbar_view.cc +++ b/chrome/browser/views/toolbar_view.cc @@ -34,9 +34,9 @@ #include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" #include "chrome/common/resource_bundle.h" +#include "chrome/views/container.h" #include "chrome/views/button_dropdown.h" #include "chrome/views/hwnd_view.h" -#include "chrome/views/view_container.h" #include "chrome/views/background.h" #include "chrome/views/label.h" #include "chrome/views/tooltip_manager.h" @@ -365,8 +365,8 @@ void BrowserToolbarView::DidGainFocus() { acc_focused_view_->SetHotTracked(true); // Show the tooltip for the view that got the focus. - if (GetViewContainer()->GetTooltipManager()) { - GetViewContainer()->GetTooltipManager()-> + if (GetContainer()->GetTooltipManager()) { + GetContainer()->GetTooltipManager()-> ShowKeyboardTooltip(acc_focused_view_); } @@ -374,7 +374,7 @@ void BrowserToolbarView::DidGainFocus() { view_index = acc_focused_view_->GetID(); } - HWND hwnd = GetViewContainer()->GetHWND(); + HWND hwnd = GetContainer()->GetHWND(); // Notify Access Technology that there was a change in keyboard focus. ::NotifyWinEvent(EVENT_OBJECT_FOCUS, hwnd, OBJID_CLIENT, @@ -385,8 +385,8 @@ void BrowserToolbarView::WillLoseFocus() { // Resetting focus state. acc_focused_view_->SetHotTracked(false); // Any tooltips that are active should be hidden when toolbar loses focus. - if (GetViewContainer() && GetViewContainer()->GetTooltipManager()) - GetViewContainer()->GetTooltipManager()->HideKeyboardTooltip(); + if (GetContainer() && GetContainer()->GetTooltipManager()) + GetContainer()->GetTooltipManager()->HideKeyboardTooltip(); acc_focused_view_ = NULL; } @@ -412,8 +412,8 @@ bool BrowserToolbarView::OnKeyPressed(const ChromeViews::KeyEvent& e) { acc_focused_view_->GetID() == VIEW_ID_APP_MENU) { // If a menu button in toolbar is activated and its menu is displayed, // then active tooltip should be hidden. - if (GetViewContainer()->GetTooltipManager()) - GetViewContainer()->GetTooltipManager()->HideKeyboardTooltip(); + if (GetContainer()->GetTooltipManager()) + GetContainer()->GetTooltipManager()->HideKeyboardTooltip(); // Safe to cast, given to above view id check. static_cast<ChromeViews::MenuButton*>(acc_focused_view_)->Activate(); if (!acc_focused_view_) { @@ -446,11 +446,11 @@ bool BrowserToolbarView::OnKeyPressed(const ChromeViews::KeyEvent& e) { // Retrieve information to generate an MSAA focus event. int view_id = acc_focused_view_->GetID(); - HWND hwnd = GetViewContainer()->GetHWND(); + HWND hwnd = GetContainer()->GetHWND(); // Show the tooltip for the view that got the focus. - if (GetViewContainer()->GetTooltipManager()) { - GetViewContainer()->GetTooltipManager()-> + if (GetContainer()->GetTooltipManager()) { + GetContainer()->GetTooltipManager()-> ShowKeyboardTooltip(GetChildViewAt(next_view)); } // Notify Access Technology that there was a change in keyboard focus. @@ -737,6 +737,6 @@ bool BrowserToolbarView::GetAcceleratorInfo(int id, return true; } // Else, we retrieve the accelerator information from the frame. - return GetViewContainer()->GetAccelerator(id, accel); + return GetContainer()->GetAccelerator(id, accel); } diff --git a/chrome/browser/views/user_data_dir_dialog.cc b/chrome/browser/views/user_data_dir_dialog.cc index 90460fb..01d181a 100644 --- a/chrome/browser/views/user_data_dir_dialog.cc +++ b/chrome/browser/views/user_data_dir_dialog.cc @@ -70,7 +70,7 @@ bool UserDataDirDialog::Accept() { std::wstring dialog_title = l10n_util::GetString( IDS_CANT_WRITE_USER_DIRECTORY_CHOOSE_DIRECTORY_BUTTON); HWND owning_hwnd = - GetAncestor(message_box_view_->GetViewContainer()->GetHWND(), GA_ROOT); + GetAncestor(message_box_view_->GetContainer()->GetHWND(), GA_ROOT); select_file_dialog_->SelectFile(SelectFileDialog::SELECT_FOLDER, dialog_title, std::wstring(), owning_hwnd, NULL); diff --git a/chrome/browser/web_contents_view_win.cc b/chrome/browser/web_contents_view_win.cc index 82380cd..4891b6f 100644 --- a/chrome/browser/web_contents_view_win.cc +++ b/chrome/browser/web_contents_view_win.cc @@ -47,7 +47,7 @@ WebContentsViewWin::~WebContentsViewWin() { void WebContentsViewWin::CreateView(HWND parent_hwnd, const gfx::Rect& initial_bounds) { set_delete_on_destroy(false); - HWNDViewContainer::Init(parent_hwnd, initial_bounds, false); + ContainerWin::Init(parent_hwnd, initial_bounds, false); // Remove the root view drop target so we can register our own. RevokeDragDrop(GetHWND()); @@ -344,7 +344,7 @@ void WebContentsViewWin::OnWindowPosChanged(WINDOWPOS* window_pos) { } void WebContentsViewWin::OnSize(UINT param, const CSize& size) { - HWNDViewContainer::OnSize(param, size); + ContainerWin::OnSize(param, size); // Hack for thinkpad touchpad driver. // Set fake scrollbars so that we can get scroll messages, diff --git a/chrome/browser/web_contents_view_win.h b/chrome/browser/web_contents_view_win.h index 459dd6e..36bcbe7 100644 --- a/chrome/browser/web_contents_view_win.h +++ b/chrome/browser/web_contents_view_win.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_WEB_CONTENTS_VIEW_WIN_H_ #include "chrome/browser/web_contents_view.h" -#include "chrome/views/hwnd_view_container.h" +#include "chrome/views/container_win.h" class InfoBarView; class InfoBarMessageView; @@ -16,7 +16,7 @@ class WebDropTarget; // Windows-specific implementation of the WebContentsView. It is a HWND that // contains all of the contents of the tab and associated child views. class WebContentsViewWin : public WebContentsView, - public ChromeViews::HWNDViewContainer { + public ChromeViews::ContainerWin { public: // The corresponding WebContents is passed in the constructor, and manages our // lifetime. This doesn't need to be the case, but is this way currently @@ -49,7 +49,7 @@ class WebContentsViewWin : public WebContentsView, private: // Windows events ------------------------------------------------------------ - // Overrides from HWNDViewContainer. + // Overrides from ContainerWin. virtual void OnDestroy(); virtual void OnHScroll(int scroll_type, short position, HWND scrollbar); virtual void OnMouseLeave(); |