| 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" |
| 35 #include "content/public/browser/notification_observer.h" | 36 #include "content/public/browser/notification_observer.h" |
| 36 #include "content/public/browser/notification_registrar.h" | 37 #include "content/public/browser/notification_registrar.h" |
| 37 #include "content/public/browser/page_navigator.h" | 38 #include "content/public/browser/page_navigator.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 } | 91 } |
| 91 | 92 |
| 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, |
| 101 public SearchTabHelperDelegate, |
| 100 public ChromeWebModalDialogManagerDelegate, | 102 public ChromeWebModalDialogManagerDelegate, |
| 101 public BookmarkTabHelperDelegate, | 103 public BookmarkTabHelperDelegate, |
| 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. |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 // External state change handling //////////////////////////////////////////// | 348 // External state change handling //////////////////////////////////////////// |
| 347 | 349 |
| 348 // Invoked when the fullscreen state of the window changes. | 350 // Invoked when the fullscreen state of the window changes. |
| 349 // BrowserWindow::EnterFullscreen invokes this after the window has become | 351 // BrowserWindow::EnterFullscreen invokes this after the window has become |
| 350 // fullscreen. | 352 // fullscreen. |
| 351 void WindowFullscreenStateChanged(); | 353 void WindowFullscreenStateChanged(); |
| 352 | 354 |
| 353 // Invoked when visible SSL state (as defined by SSLStatus) changes. | 355 // Invoked when visible SSL state (as defined by SSLStatus) changes. |
| 354 void VisibleSSLStateChanged(content::WebContents* web_contents); | 356 void VisibleSSLStateChanged(content::WebContents* web_contents); |
| 355 | 357 |
| 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 //////////////////////////////////////////////// | 358 // Assorted browser commands //////////////////////////////////////////////// |
| 362 | 359 |
| 363 // NOTE: Within each of the following sections, the IDs are ordered roughly by | 360 // 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.). | 361 // how they appear in the GUI/menus (left to right, top to bottom, etc.). |
| 365 | 362 |
| 366 // See the description of | 363 // See the description of |
| 367 // FullscreenController::ToggleFullscreenModeWithExtension. | 364 // FullscreenController::ToggleFullscreenModeWithExtension. |
| 368 void ToggleFullscreenModeWithExtension(const GURL& extension_url); | 365 void ToggleFullscreenModeWithExtension(const GURL& extension_url); |
| 369 #if defined(OS_WIN) | 366 #if defined(OS_WIN) |
| 370 // See the description of FullscreenController::ToggleMetroSnapMode. | 367 // 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; | 652 bool did_finish_load) OVERRIDE; |
| 656 virtual bool CanReloadContents( | 653 virtual bool CanReloadContents( |
| 657 content::WebContents* web_contents) const OVERRIDE; | 654 content::WebContents* web_contents) const OVERRIDE; |
| 658 virtual bool CanSaveContents( | 655 virtual bool CanSaveContents( |
| 659 content::WebContents* web_contents) const OVERRIDE; | 656 content::WebContents* web_contents) const OVERRIDE; |
| 660 | 657 |
| 661 // Overridden from SearchEngineTabHelperDelegate: | 658 // Overridden from SearchEngineTabHelperDelegate: |
| 662 virtual void ConfirmAddSearchProvider(TemplateURL* template_url, | 659 virtual void ConfirmAddSearchProvider(TemplateURL* template_url, |
| 663 Profile* profile) OVERRIDE; | 660 Profile* profile) OVERRIDE; |
| 664 | 661 |
| 662 // Overridden from SearchTabHelperDelegate: |
| 663 virtual void NavigateOnThumbnailClick( |
| 664 const GURL& url, |
| 665 WindowOpenDisposition disposition, |
| 666 content::WebContents* source_contents) OVERRIDE; |
| 667 virtual void OnWebContentsInstantSupportDisabled( |
| 668 const content::WebContents* web_contents) OVERRIDE; |
| 669 virtual OmniboxView* GetOmniboxView() OVERRIDE; |
| 670 virtual std::set<std::string> GetOpenUrls() OVERRIDE; |
| 671 |
| 665 // Overridden from WebContentsModalDialogManagerDelegate: | 672 // Overridden from WebContentsModalDialogManagerDelegate: |
| 666 virtual void SetWebContentsBlocked(content::WebContents* web_contents, | 673 virtual void SetWebContentsBlocked(content::WebContents* web_contents, |
| 667 bool blocked) OVERRIDE; | 674 bool blocked) OVERRIDE; |
| 668 virtual web_modal::WebContentsModalDialogHost* | 675 virtual web_modal::WebContentsModalDialogHost* |
| 669 GetWebContentsModalDialogHost() OVERRIDE; | 676 GetWebContentsModalDialogHost() OVERRIDE; |
| 670 | 677 |
| 671 // Overridden from BookmarkTabHelperDelegate: | 678 // Overridden from BookmarkTabHelperDelegate: |
| 672 virtual void URLStarredChanged(content::WebContents* web_contents, | 679 virtual void URLStarredChanged(content::WebContents* web_contents, |
| 673 bool starred) OVERRIDE; | 680 bool starred) OVERRIDE; |
| 674 | 681 |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 928 base::WeakPtrFactory<Browser> weak_factory_; | 935 base::WeakPtrFactory<Browser> weak_factory_; |
| 929 | 936 |
| 930 scoped_ptr<BrowserContentTranslateDriverObserver> translate_driver_observer_; | 937 scoped_ptr<BrowserContentTranslateDriverObserver> translate_driver_observer_; |
| 931 | 938 |
| 932 scoped_ptr<chrome::ValidationMessageBubble> validation_message_bubble_; | 939 scoped_ptr<chrome::ValidationMessageBubble> validation_message_bubble_; |
| 933 | 940 |
| 934 DISALLOW_COPY_AND_ASSIGN(Browser); | 941 DISALLOW_COPY_AND_ASSIGN(Browser); |
| 935 }; | 942 }; |
| 936 | 943 |
| 937 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 944 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
| OLD | NEW |