| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/timer.h" | 14 #include "base/timer.h" |
| 15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 16 #include "chrome/browser/infobars/infobar_container.h" | 16 #include "chrome/browser/infobars/infobar_container.h" |
| 17 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
| 18 #include "chrome/browser/ui/browser_window.h" | 18 #include "chrome/browser/ui/browser_window.h" |
| 19 #include "chrome/browser/ui/metro_pinned_state_observer.h" |
| 19 #include "chrome/browser/ui/search/search_types.h" | 20 #include "chrome/browser/ui/search/search_types.h" |
| 20 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 21 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
| 21 #include "chrome/browser/ui/views/frame/browser_frame.h" | 22 #include "chrome/browser/ui/views/frame/browser_frame.h" |
| 22 #include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h" | 23 #include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h" |
| 23 #include "ui/base/accelerators/accelerator.h" | 24 #include "ui/base/accelerators/accelerator.h" |
| 24 #include "ui/base/models/simple_menu_model.h" | 25 #include "ui/base/models/simple_menu_model.h" |
| 25 #include "ui/gfx/native_widget_types.h" | 26 #include "ui/gfx/native_widget_types.h" |
| 26 #include "ui/gfx/sys_color_change_listener.h" | 27 #include "ui/gfx/sys_color_change_listener.h" |
| 27 #include "ui/views/controls/button/button.h" | 28 #include "ui/views/controls/button/button.h" |
| 28 #include "ui/views/controls/single_split_view_listener.h" | 29 #include "ui/views/controls/single_split_view_listener.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // | 86 // |
| 86 class BrowserView : public BrowserWindow, | 87 class BrowserView : public BrowserWindow, |
| 87 public BrowserWindowTesting, | 88 public BrowserWindowTesting, |
| 88 public TabStripModelObserver, | 89 public TabStripModelObserver, |
| 89 public ui::AcceleratorProvider, | 90 public ui::AcceleratorProvider, |
| 90 public views::WidgetDelegate, | 91 public views::WidgetDelegate, |
| 91 public views::Widget::Observer, | 92 public views::Widget::Observer, |
| 92 public views::ClientView, | 93 public views::ClientView, |
| 93 public InfoBarContainer::Delegate, | 94 public InfoBarContainer::Delegate, |
| 94 public views::SingleSplitViewListener, | 95 public views::SingleSplitViewListener, |
| 95 public gfx::SysColorChangeListener { | 96 public gfx::SysColorChangeListener, |
| 97 public MetroPinnedStateObserver { |
| 96 public: | 98 public: |
| 97 // The browser view's class name. | 99 // The browser view's class name. |
| 98 static const char kViewClassName[]; | 100 static const char kViewClassName[]; |
| 99 | 101 |
| 100 explicit BrowserView(Browser* browser); | 102 explicit BrowserView(Browser* browser); |
| 101 virtual ~BrowserView(); | 103 virtual ~BrowserView(); |
| 102 | 104 |
| 103 void set_frame(BrowserFrame* frame) { frame_ = frame; } | 105 void set_frame(BrowserFrame* frame) { frame_ = frame; } |
| 104 BrowserFrame* frame() const { return frame_; } | 106 BrowserFrame* frame() const { return frame_; } |
| 105 | 107 |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 autofill::PasswordGenerator* password_generator, | 348 autofill::PasswordGenerator* password_generator, |
| 347 const webkit::forms::PasswordForm& form) OVERRIDE; | 349 const webkit::forms::PasswordForm& form) OVERRIDE; |
| 348 | 350 |
| 349 // Overridden from BrowserWindowTesting: | 351 // Overridden from BrowserWindowTesting: |
| 350 virtual BookmarkBarView* GetBookmarkBarView() const OVERRIDE; | 352 virtual BookmarkBarView* GetBookmarkBarView() const OVERRIDE; |
| 351 virtual LocationBarView* GetLocationBarView() const OVERRIDE; | 353 virtual LocationBarView* GetLocationBarView() const OVERRIDE; |
| 352 virtual views::View* GetTabContentsContainerView() const OVERRIDE; | 354 virtual views::View* GetTabContentsContainerView() const OVERRIDE; |
| 353 virtual ToolbarView* GetToolbarView() const OVERRIDE; | 355 virtual ToolbarView* GetToolbarView() const OVERRIDE; |
| 354 | 356 |
| 355 // Overridden from TabStripModelObserver: | 357 // Overridden from TabStripModelObserver: |
| 358 virtual void TabInsertedAt(TabContents* contents, |
| 359 int index, |
| 360 bool foreground) OVERRIDE; |
| 356 virtual void TabDetachedAt(TabContents* contents, int index) OVERRIDE; | 361 virtual void TabDetachedAt(TabContents* contents, int index) OVERRIDE; |
| 357 virtual void TabDeactivated(TabContents* contents) OVERRIDE; | 362 virtual void TabDeactivated(TabContents* contents) OVERRIDE; |
| 358 virtual void ActiveTabChanged(TabContents* old_contents, | 363 virtual void ActiveTabChanged(TabContents* old_contents, |
| 359 TabContents* new_contents, | 364 TabContents* new_contents, |
| 360 int index, | 365 int index, |
| 361 bool user_gesture) OVERRIDE; | 366 bool user_gesture) OVERRIDE; |
| 362 virtual void TabReplacedAt(TabStripModel* tab_strip_model, | 367 virtual void TabReplacedAt(TabStripModel* tab_strip_model, |
| 363 TabContents* old_contents, | 368 TabContents* old_contents, |
| 364 TabContents* new_contents, | 369 TabContents* new_contents, |
| 365 int index) OVERRIDE; | 370 int index) OVERRIDE; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 virtual SkColor GetInfoBarSeparatorColor() const OVERRIDE; | 412 virtual SkColor GetInfoBarSeparatorColor() const OVERRIDE; |
| 408 virtual void InfoBarContainerStateChanged(bool is_animating) OVERRIDE; | 413 virtual void InfoBarContainerStateChanged(bool is_animating) OVERRIDE; |
| 409 virtual bool DrawInfoBarArrows(int* x) const OVERRIDE; | 414 virtual bool DrawInfoBarArrows(int* x) const OVERRIDE; |
| 410 | 415 |
| 411 // views::SingleSplitViewListener overrides: | 416 // views::SingleSplitViewListener overrides: |
| 412 virtual bool SplitHandleMoved(views::SingleSplitView* sender) OVERRIDE; | 417 virtual bool SplitHandleMoved(views::SingleSplitView* sender) OVERRIDE; |
| 413 | 418 |
| 414 // gfx::ScopedSysColorChangeListener overrides: | 419 // gfx::ScopedSysColorChangeListener overrides: |
| 415 virtual void OnSysColorChange() OVERRIDE; | 420 virtual void OnSysColorChange() OVERRIDE; |
| 416 | 421 |
| 422 // MetroPinnedStateObserver overrides: |
| 423 virtual void MetroPinnedStateChanged(content::WebContents* contents, |
| 424 bool is_pinned) OVERRIDE; |
| 425 |
| 417 // Returns the resource ID to use for the OTR icon, which depends on | 426 // Returns the resource ID to use for the OTR icon, which depends on |
| 418 // which layout is being shown and whether we are full-screen. | 427 // which layout is being shown and whether we are full-screen. |
| 419 int GetOTRIconResourceID() const; | 428 int GetOTRIconResourceID() const; |
| 420 | 429 |
| 421 protected: | 430 protected: |
| 422 // Appends to |toolbars| a pointer to each AccessiblePaneView that | 431 // Appends to |toolbars| a pointer to each AccessiblePaneView that |
| 423 // can be traversed using F6, in the order they should be traversed. | 432 // can be traversed using F6, in the order they should be traversed. |
| 424 // Abstracted here so that it can be extended for Chrome OS. | 433 // Abstracted here so that it can be extended for Chrome OS. |
| 425 virtual void GetAccessiblePanes( | 434 virtual void GetAccessiblePanes( |
| 426 std::vector<views::AccessiblePaneView*>* panes); | 435 std::vector<views::AccessiblePaneView*>* panes); |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 gfx::ScopedSysColorChangeListener color_change_listener_; | 721 gfx::ScopedSysColorChangeListener color_change_listener_; |
| 713 | 722 |
| 714 #if defined(USE_AURA) | 723 #if defined(USE_AURA) |
| 715 scoped_ptr<SearchViewController> search_view_controller_; | 724 scoped_ptr<SearchViewController> search_view_controller_; |
| 716 #endif | 725 #endif |
| 717 | 726 |
| 718 DISALLOW_COPY_AND_ASSIGN(BrowserView); | 727 DISALLOW_COPY_AND_ASSIGN(BrowserView); |
| 719 }; | 728 }; |
| 720 | 729 |
| 721 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ | 730 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ |
| OLD | NEW |