1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CHROME_BROWSER_CHROMEOS_FRAME_DOM_BROWSER_VIEW_H_ 6 #define CHROME_BROWSER_CHROMEOS_FRAME_DOM_BROWSER_VIEW_H_ 7 #pragma once 8 9 #include <vector> 10 11 #include "base/compiler_specific.h" 12 #include "chrome/browser/chromeos/frame/browser_view.h" 13 14 namespace chromeos { 15 16 // DOMBrowserView overides a large number of methods that are defined in 17 // chromeos::BrowserView and BrowserView to resolve issues with UX components 18 // like the Tabstrip and Location Bar being removed. It also overides the 19 // construction functions required to create these UX elements. 20 class DOMBrowserView : public chromeos::BrowserView { 21 public: 22 explicit DOMBrowserView(Browser* browser); 23 virtual ~DOMBrowserView(); 24 25 // Create a DOMBrowserView for a DOMBrowser. 26 static BrowserWindow* CreateDOMWindow(Browser* browser); 27 28 // BrowserView overrides 29 virtual void WindowMoveOrResizeStarted() OVERRIDE; 30 virtual gfx::Rect GetToolbarBounds() const OVERRIDE; 31 virtual int GetTabStripHeight() const OVERRIDE; 32 virtual bool IsTabStripVisible() const OVERRIDE; 33 virtual bool AcceleratorPressed(const views::Accelerator& accelerator) 34 OVERRIDE; 35 virtual void SetStarredState(bool is_starred) OVERRIDE; 36 virtual LocationBar* GetLocationBar() const OVERRIDE; 37 virtual void SetFocusToLocationBar(bool select_all) OVERRIDE; 38 virtual void UpdateReloadStopState(bool is_loading, bool force) OVERRIDE; 39 virtual void UpdateToolbar(TabContentsWrapper* contents, 40 bool should_restore_state) OVERRIDE; 41 virtual void FocusToolbar() OVERRIDE; 42 virtual void FocusAppMenu() OVERRIDE; 43 virtual void ShowBookmarkBubble(const GURL& url, bool already_bookmarked) 44 OVERRIDE; 45 virtual void ShowAppMenu() OVERRIDE; 46 virtual LocationBarView* GetLocationBarView() const OVERRIDE; 47 virtual ToolbarView* GetToolbarView() const OVERRIDE; 48 virtual bool ShouldShowOffTheRecordAvatar() const OVERRIDE; 49 virtual bool GetAcceleratorForCommandId(int command_id, 50 ui::Accelerator* accelerator) 51 OVERRIDE; 52 53 // BrowserWindow overrides 54 bool IsToolbarVisible() const OVERRIDE; 55 56 protected: 57 // BrowserView overrides 58 virtual void GetAccessiblePanes( 59 std::vector<AccessiblePaneView*>* panes) OVERRIDE; 60 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; 61 virtual void InitTabStrip(TabStripModel* model) OVERRIDE; 62 virtual views::LayoutManager* CreateLayoutManager() const OVERRIDE; 63 virtual ToolbarView* CreateToolbar() const OVERRIDE; 64 virtual void LoadingAnimationCallback() OVERRIDE; 65 66 private: 67 DISALLOW_COPY_AND_ASSIGN(DOMBrowserView); 68 }; 69 70 } // namespace chromeos 71 72 #endif // CHROME_BROWSER_CHROMEOS_FRAME_DOM_BROWSER_VIEW_H_ 73