Chromium Code Reviews| 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "base/prefs/pref_change_registrar.h" | 18 #include "base/prefs/pref_change_registrar.h" |
| 19 #include "base/prefs/pref_member.h" | 19 #include "base/prefs/pref_member.h" |
| 20 #include "base/strings/string16.h" | 20 #include "base/strings/string16.h" |
| 21 #include "chrome/browser/devtools/devtools_toggle_action.h" | 21 #include "chrome/browser/devtools/devtools_toggle_action.h" |
| 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/search_tab_helper_delegate.h" | |
| 28 #include "chrome/browser/ui/search_engines/search_engine_tab_helper_delegate.h" | 29 #include "chrome/browser/ui/search_engines/search_engine_tab_helper_delegate.h" |
| 29 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" | 30 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" |
| 30 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 31 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
| 31 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 32 #include "chrome/browser/ui/toolbar/toolbar_model.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" |
| 36 #include "chrome/common/instant_types.h" | |
| 35 #include "content/public/browser/notification_observer.h" | 37 #include "content/public/browser/notification_observer.h" |
| 36 #include "content/public/browser/notification_registrar.h" | 38 #include "content/public/browser/notification_registrar.h" |
| 37 #include "content/public/browser/page_navigator.h" | 39 #include "content/public/browser/page_navigator.h" |
| 38 #include "content/public/browser/web_contents_delegate.h" | 40 #include "content/public/browser/web_contents_delegate.h" |
| 39 #include "content/public/common/page_transition_types.h" | 41 #include "content/public/common/page_transition_types.h" |
| 40 #include "content/public/common/page_zoom.h" | 42 #include "content/public/common/page_zoom.h" |
| 41 #include "ui/base/ui_base_types.h" | 43 #include "ui/base/ui_base_types.h" |
| 42 #include "ui/base/window_open_disposition.h" | 44 #include "ui/base/window_open_disposition.h" |
| 43 #include "ui/gfx/rect.h" | 45 #include "ui/gfx/rect.h" |
| 44 #include "ui/shell_dialogs/select_file_dialog.h" | 46 #include "ui/shell_dialogs/select_file_dialog.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 } | 92 } |
| 91 | 93 |
| 92 namespace web_modal { | 94 namespace web_modal { |
| 93 class WebContentsModalDialogHost; | 95 class WebContentsModalDialogHost; |
| 94 } | 96 } |
| 95 | 97 |
| 96 class Browser : public TabStripModelObserver, | 98 class Browser : public TabStripModelObserver, |
| 97 public content::WebContentsDelegate, | 99 public content::WebContentsDelegate, |
| 98 public CoreTabHelperDelegate, | 100 public CoreTabHelperDelegate, |
| 99 public SearchEngineTabHelperDelegate, | 101 public SearchEngineTabHelperDelegate, |
| 102 public SearchTabHelperDelegate, | |
|
Jered
2014/04/04 22:39:27
(no action required) Ugh what is a HelperDelegate?
kmadhusu
2014/04/07 21:44:15
If you prefer, we can rename this to "SearchTabDel
Jered
2014/04/08 12:32:10
I guess it is the delegate of SearchTabHelper, so
| |
| 100 public ChromeWebModalDialogManagerDelegate, | 103 public ChromeWebModalDialogManagerDelegate, |
| 101 public BookmarkTabHelperDelegate, | 104 public BookmarkTabHelperDelegate, |
| 102 public ZoomObserver, | 105 public ZoomObserver, |
| 103 public content::PageNavigator, | 106 public content::PageNavigator, |
| 104 public content::NotificationObserver, | 107 public content::NotificationObserver, |
| 105 public ui::SelectFileDialog::Listener { | 108 public ui::SelectFileDialog::Listener { |
| 106 public: | 109 public: |
| 107 // SessionService::WindowType mirrors these values. If you add to this | 110 // SessionService::WindowType mirrors these values. If you add to this |
| 108 // enum, look at SessionService::WindowType to see if it needs to be | 111 // enum, look at SessionService::WindowType to see if it needs to be |
| 109 // updated. | 112 // updated. |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 346 // External state change handling //////////////////////////////////////////// | 349 // External state change handling //////////////////////////////////////////// |
| 347 | 350 |
| 348 // Invoked when the fullscreen state of the window changes. | 351 // Invoked when the fullscreen state of the window changes. |
| 349 // BrowserWindow::EnterFullscreen invokes this after the window has become | 352 // BrowserWindow::EnterFullscreen invokes this after the window has become |
| 350 // fullscreen. | 353 // fullscreen. |
| 351 void WindowFullscreenStateChanged(); | 354 void WindowFullscreenStateChanged(); |
| 352 | 355 |
| 353 // Invoked when visible SSL state (as defined by SSLStatus) changes. | 356 // Invoked when visible SSL state (as defined by SSLStatus) changes. |
| 354 void VisibleSSLStateChanged(content::WebContents* web_contents); | 357 void VisibleSSLStateChanged(content::WebContents* web_contents); |
| 355 | 358 |
| 356 // Invoked when the |web_contents| no longer supports Instant. Refreshes the | |
| 357 // omnibox so it no longer shows search terms. | |
| 358 void OnWebContentsInstantSupportDisabled( | |
| 359 const content::WebContents* web_contents); | |
| 360 | |
| 361 // Assorted browser commands //////////////////////////////////////////////// | 359 // Assorted browser commands //////////////////////////////////////////////// |
| 362 | 360 |
| 363 // NOTE: Within each of the following sections, the IDs are ordered roughly by | 361 // NOTE: Within each of the following sections, the IDs are ordered roughly by |
| 364 // how they appear in the GUI/menus (left to right, top to bottom, etc.). | 362 // how they appear in the GUI/menus (left to right, top to bottom, etc.). |
| 365 | 363 |
| 366 // See the description of | 364 // See the description of |
| 367 // FullscreenController::ToggleFullscreenModeWithExtension. | 365 // FullscreenController::ToggleFullscreenModeWithExtension. |
| 368 void ToggleFullscreenModeWithExtension(const GURL& extension_url); | 366 void ToggleFullscreenModeWithExtension(const GURL& extension_url); |
| 369 #if defined(OS_WIN) | 367 #if defined(OS_WIN) |
| 370 // See the description of FullscreenController::ToggleMetroSnapMode. | 368 // See the description of FullscreenController::ToggleMetroSnapMode. |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 655 bool did_finish_load) OVERRIDE; | 653 bool did_finish_load) OVERRIDE; |
| 656 virtual bool CanReloadContents( | 654 virtual bool CanReloadContents( |
| 657 content::WebContents* web_contents) const OVERRIDE; | 655 content::WebContents* web_contents) const OVERRIDE; |
| 658 virtual bool CanSaveContents( | 656 virtual bool CanSaveContents( |
| 659 content::WebContents* web_contents) const OVERRIDE; | 657 content::WebContents* web_contents) const OVERRIDE; |
| 660 | 658 |
| 661 // Overridden from SearchEngineTabHelperDelegate: | 659 // Overridden from SearchEngineTabHelperDelegate: |
| 662 virtual void ConfirmAddSearchProvider(TemplateURL* template_url, | 660 virtual void ConfirmAddSearchProvider(TemplateURL* template_url, |
| 663 Profile* profile) OVERRIDE; | 661 Profile* profile) OVERRIDE; |
| 664 | 662 |
| 663 // Overridden from SearchTabHelperDelegate: | |
| 664 virtual void NavigateToURL( | |
| 665 const GURL& url, | |
| 666 WindowOpenDisposition disposition, | |
| 667 content::WebContents* source_contents) OVERRIDE; | |
| 668 virtual void OnWebContentsInstantSupportDisabled( | |
| 669 const content::WebContents* web_contents) OVERRIDE; | |
| 670 virtual void RemoveMostVisitedItemsMatchingOpenTabs( | |
|
Jered
2014/04/04 22:39:27
This seems like pushing too much into Browser. Ins
kmadhusu
2014/04/07 21:44:15
Done.
| |
| 671 std::vector<InstantMostVisitedItem>* items) OVERRIDE; | |
| 672 virtual OmniboxView* GetOmniboxView() OVERRIDE; | |
| 673 | |
| 665 // Overridden from WebContentsModalDialogManagerDelegate: | 674 // Overridden from WebContentsModalDialogManagerDelegate: |
| 666 virtual void SetWebContentsBlocked(content::WebContents* web_contents, | 675 virtual void SetWebContentsBlocked(content::WebContents* web_contents, |
| 667 bool blocked) OVERRIDE; | 676 bool blocked) OVERRIDE; |
| 668 virtual web_modal::WebContentsModalDialogHost* | 677 virtual web_modal::WebContentsModalDialogHost* |
| 669 GetWebContentsModalDialogHost() OVERRIDE; | 678 GetWebContentsModalDialogHost() OVERRIDE; |
| 670 | 679 |
| 671 // Overridden from BookmarkTabHelperDelegate: | 680 // Overridden from BookmarkTabHelperDelegate: |
| 672 virtual void URLStarredChanged(content::WebContents* web_contents, | 681 virtual void URLStarredChanged(content::WebContents* web_contents, |
| 673 bool starred) OVERRIDE; | 682 bool starred) OVERRIDE; |
| 674 | 683 |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 928 base::WeakPtrFactory<Browser> weak_factory_; | 937 base::WeakPtrFactory<Browser> weak_factory_; |
| 929 | 938 |
| 930 scoped_ptr<BrowserContentTranslateDriverObserver> translate_driver_observer_; | 939 scoped_ptr<BrowserContentTranslateDriverObserver> translate_driver_observer_; |
| 931 | 940 |
| 932 scoped_ptr<chrome::ValidationMessageBubble> validation_message_bubble_; | 941 scoped_ptr<chrome::ValidationMessageBubble> validation_message_bubble_; |
| 933 | 942 |
| 934 DISALLOW_COPY_AND_ASSIGN(Browser); | 943 DISALLOW_COPY_AND_ASSIGN(Browser); |
| 935 }; | 944 }; |
| 936 | 945 |
| 937 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 946 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
| OLD | NEW |