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