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_BROWSER_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_H_ |
6 #define CHROME_BROWSER_UI_BROWSER_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 11 matching lines...) Expand all Loading... | |
22 #include "chrome/browser/sessions/session_id.h" | 22 #include "chrome/browser/sessions/session_id.h" |
23 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" | 23 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" |
24 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper_delegate.h" | 24 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper_delegate.h" |
25 #include "chrome/browser/ui/browser_navigator.h" | 25 #include "chrome/browser/ui/browser_navigator.h" |
26 #include "chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h" | 26 #include "chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h" |
27 #include "chrome/browser/ui/host_desktop.h" | 27 #include "chrome/browser/ui/host_desktop.h" |
28 #include "chrome/browser/ui/search_engines/search_engine_tab_helper_delegate.h" | 28 #include "chrome/browser/ui/search_engines/search_engine_tab_helper_delegate.h" |
29 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" | 29 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" |
30 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 30 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
31 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 31 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
32 #include "chrome/browser/ui/web_applications/hosted_app_tab_helper_delegate.h" | |
32 #include "chrome/browser/ui/zoom/zoom_observer.h" | 33 #include "chrome/browser/ui/zoom/zoom_observer.h" |
33 #include "chrome/common/content_settings.h" | 34 #include "chrome/common/content_settings.h" |
34 #include "chrome/common/content_settings_types.h" | 35 #include "chrome/common/content_settings_types.h" |
35 #include "chrome/common/extensions/extension_constants.h" | 36 #include "chrome/common/extensions/extension_constants.h" |
36 #include "content/public/browser/notification_observer.h" | 37 #include "content/public/browser/notification_observer.h" |
37 #include "content/public/browser/notification_registrar.h" | 38 #include "content/public/browser/notification_registrar.h" |
38 #include "content/public/browser/page_navigator.h" | 39 #include "content/public/browser/page_navigator.h" |
39 #include "content/public/browser/web_contents_delegate.h" | 40 #include "content/public/browser/web_contents_delegate.h" |
40 #include "content/public/common/page_transition_types.h" | 41 #include "content/public/common/page_transition_types.h" |
41 #include "content/public/common/page_zoom.h" | 42 #include "content/public/common/page_zoom.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
92 namespace web_modal { | 93 namespace web_modal { |
93 class WebContentsModalDialogHost; | 94 class WebContentsModalDialogHost; |
94 } | 95 } |
95 | 96 |
96 class Browser : public TabStripModelObserver, | 97 class Browser : public TabStripModelObserver, |
97 public content::WebContentsDelegate, | 98 public content::WebContentsDelegate, |
98 public CoreTabHelperDelegate, | 99 public CoreTabHelperDelegate, |
99 public SearchEngineTabHelperDelegate, | 100 public SearchEngineTabHelperDelegate, |
100 public ChromeWebModalDialogManagerDelegate, | 101 public ChromeWebModalDialogManagerDelegate, |
101 public BookmarkTabHelperDelegate, | 102 public BookmarkTabHelperDelegate, |
103 public HostedAppTabHelperDelegate, | |
102 public ZoomObserver, | 104 public ZoomObserver, |
103 public content::PageNavigator, | 105 public content::PageNavigator, |
104 public content::NotificationObserver, | 106 public content::NotificationObserver, |
105 public ui::SelectFileDialog::Listener { | 107 public ui::SelectFileDialog::Listener { |
106 public: | 108 public: |
107 // SessionService::WindowType mirrors these values. If you add to this | 109 // SessionService::WindowType mirrors these values. If you add to this |
108 // enum, look at SessionService::WindowType to see if it needs to be | 110 // enum, look at SessionService::WindowType to see if it needs to be |
109 // updated. | 111 // updated. |
110 enum Type { | 112 enum Type { |
111 // If you add a new type, consider updating the test | 113 // If you add a new type, consider updating the test |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
275 | 277 |
276 // Returns true if a FindBarController exists for this browser. | 278 // Returns true if a FindBarController exists for this browser. |
277 bool HasFindBarController() const; | 279 bool HasFindBarController() const; |
278 | 280 |
279 // Returns the state of the bookmark bar. | 281 // Returns the state of the bookmark bar. |
280 BookmarkBar::State bookmark_bar_state() const { return bookmark_bar_state_; } | 282 BookmarkBar::State bookmark_bar_state() const { return bookmark_bar_state_; } |
281 | 283 |
282 // State Storage and Retrieval for UI /////////////////////////////////////// | 284 // State Storage and Retrieval for UI /////////////////////////////////////// |
283 | 285 |
284 // Gets the Favicon of the page in the selected tab. | 286 // Gets the Favicon of the page in the selected tab. |
285 gfx::Image GetCurrentPageIcon() const; | 287 const gfx::Image GetCurrentPageIcon(int icon_size) const; |
tapted
2013/11/11 08:52:57
nit: non-reference `const` return types aren't usu
calamity
2013/11/13 06:37:14
Done.
| |
286 | 288 |
287 // Gets the title of the window based on the selected tab's title. | 289 // Gets the title of the window based on the selected tab's title. |
288 string16 GetWindowTitleForCurrentTab() const; | 290 string16 GetWindowTitleForCurrentTab() const; |
289 | 291 |
290 // Prepares a title string for display (removes embedded newlines, etc). | 292 // Prepares a title string for display (removes embedded newlines, etc). |
291 static void FormatTitleForDisplay(string16* title); | 293 static void FormatTitleForDisplay(string16* title); |
292 | 294 |
293 // OnBeforeUnload handling ////////////////////////////////////////////////// | 295 // OnBeforeUnload handling ////////////////////////////////////////////////// |
294 | 296 |
295 // Gives beforeunload handlers the chance to cancel the close. Returns whether | 297 // Gives beforeunload handlers the chance to cancel the close. Returns whether |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
672 // Overridden from WebContentsModalDialogManagerDelegate: | 674 // Overridden from WebContentsModalDialogManagerDelegate: |
673 virtual void SetWebContentsBlocked(content::WebContents* web_contents, | 675 virtual void SetWebContentsBlocked(content::WebContents* web_contents, |
674 bool blocked) OVERRIDE; | 676 bool blocked) OVERRIDE; |
675 virtual web_modal::WebContentsModalDialogHost* | 677 virtual web_modal::WebContentsModalDialogHost* |
676 GetWebContentsModalDialogHost() OVERRIDE; | 678 GetWebContentsModalDialogHost() OVERRIDE; |
677 | 679 |
678 // Overridden from BookmarkTabHelperDelegate: | 680 // Overridden from BookmarkTabHelperDelegate: |
679 virtual void URLStarredChanged(content::WebContents* web_contents, | 681 virtual void URLStarredChanged(content::WebContents* web_contents, |
680 bool starred) OVERRIDE; | 682 bool starred) OVERRIDE; |
681 | 683 |
684 // Overriden from HostedAppTabHelper: | |
685 virtual void OnWindowIconLoaded(content::WebContents* source) OVERRIDE; | |
686 | |
682 // Overridden from ZoomObserver: | 687 // Overridden from ZoomObserver: |
683 virtual void OnZoomChanged(content::WebContents* source, | 688 virtual void OnZoomChanged(content::WebContents* source, |
684 bool can_show_bubble) OVERRIDE; | 689 bool can_show_bubble) OVERRIDE; |
685 | 690 |
686 // Overridden from SelectFileDialog::Listener: | 691 // Overridden from SelectFileDialog::Listener: |
687 virtual void FileSelected(const base::FilePath& path, | 692 virtual void FileSelected(const base::FilePath& path, |
688 int index, | 693 int index, |
689 void* params) OVERRIDE; | 694 void* params) OVERRIDE; |
690 virtual void FileSelectedWithExtraInfo( | 695 virtual void FileSelectedWithExtraInfo( |
691 const ui::SelectedFileInfo& file_info, | 696 const ui::SelectedFileInfo& file_info, |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
935 | 940 |
936 // The following factory is used to close the frame at a later time. | 941 // The following factory is used to close the frame at a later time. |
937 base::WeakPtrFactory<Browser> weak_factory_; | 942 base::WeakPtrFactory<Browser> weak_factory_; |
938 | 943 |
939 scoped_ptr<BrowserLanguageStateObserver> language_state_observer_; | 944 scoped_ptr<BrowserLanguageStateObserver> language_state_observer_; |
940 | 945 |
941 DISALLOW_COPY_AND_ASSIGN(Browser); | 946 DISALLOW_COPY_AND_ASSIGN(Browser); |
942 }; | 947 }; |
943 | 948 |
944 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 949 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
OLD | NEW |