| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
| 22 #include "chrome/browser/devtools/devtools_toggle_action.h" | 22 #include "chrome/browser/devtools/devtools_toggle_action.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/browser_navigator_params.h" | 26 #include "chrome/browser/ui/browser_navigator_params.h" |
| 27 #include "chrome/browser/ui/chrome_bubble_manager.h" | 27 #include "chrome/browser/ui/chrome_bubble_manager.h" |
| 28 #include "chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h" | 28 #include "chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h" |
| 29 #include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h" | 29 #include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h" |
| 30 #include "chrome/browser/ui/profile_chooser_constants.h" | 30 #include "chrome/browser/ui/profile_chooser_constants.h" |
| 31 #include "chrome/browser/ui/signin_view_controller.h" | |
| 32 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" | 31 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" |
| 33 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 32 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
| 34 #include "components/content_settings/core/common/content_settings.h" | 33 #include "components/content_settings/core/common/content_settings.h" |
| 35 #include "components/content_settings/core/common/content_settings_types.h" | 34 #include "components/content_settings/core/common/content_settings_types.h" |
| 36 #include "components/prefs/pref_change_registrar.h" | 35 #include "components/prefs/pref_change_registrar.h" |
| 37 #include "components/sessions/core/session_id.h" | 36 #include "components/sessions/core/session_id.h" |
| 38 #include "components/toolbar/toolbar_model.h" | 37 #include "components/toolbar/toolbar_model.h" |
| 39 #include "components/translate/content/browser/content_translate_driver.h" | 38 #include "components/translate/content/browser/content_translate_driver.h" |
| 40 #include "components/zoom/zoom_observer.h" | 39 #include "components/zoom/zoom_observer.h" |
| 41 #include "content/public/browser/notification_observer.h" | 40 #include "content/public/browser/notification_observer.h" |
| 42 #include "content/public/browser/notification_registrar.h" | 41 #include "content/public/browser/notification_registrar.h" |
| 43 #include "content/public/browser/page_navigator.h" | 42 #include "content/public/browser/page_navigator.h" |
| 44 #include "content/public/browser/web_contents.h" | 43 #include "content/public/browser/web_contents.h" |
| 45 #include "content/public/browser/web_contents_delegate.h" | 44 #include "content/public/browser/web_contents_delegate.h" |
| 46 #include "content/public/common/page_zoom.h" | 45 #include "content/public/common/page_zoom.h" |
| 47 #include "extensions/features/features.h" | 46 #include "extensions/features/features.h" |
| 48 #include "ui/base/page_transition_types.h" | 47 #include "ui/base/page_transition_types.h" |
| 49 #include "ui/base/ui_base_types.h" | 48 #include "ui/base/ui_base_types.h" |
| 50 #include "ui/base/window_open_disposition.h" | 49 #include "ui/base/window_open_disposition.h" |
| 51 #include "ui/gfx/geometry/rect.h" | 50 #include "ui/gfx/geometry/rect.h" |
| 52 #include "ui/shell_dialogs/select_file_dialog.h" | 51 #include "ui/shell_dialogs/select_file_dialog.h" |
| 53 | 52 |
| 53 #if !defined(OS_CHROMEOS) |
| 54 #include "chrome/browser/ui/signin_view_controller.h" |
| 55 #endif |
| 56 |
| 54 #if BUILDFLAG(ENABLE_EXTENSIONS) | 57 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 55 #include "extensions/browser/extension_registry_observer.h" | 58 #include "extensions/browser/extension_registry_observer.h" |
| 56 #endif | 59 #endif |
| 57 | 60 |
| 58 class BrowserContentSettingBubbleModelDelegate; | 61 class BrowserContentSettingBubbleModelDelegate; |
| 59 class BrowserInstantController; | 62 class BrowserInstantController; |
| 60 class BrowserSyncedWindowDelegate; | 63 class BrowserSyncedWindowDelegate; |
| 61 class BrowserToolbarModelDelegate; | 64 class BrowserToolbarModelDelegate; |
| 62 class BrowserLiveTabContext; | 65 class BrowserLiveTabContext; |
| 63 class BrowserWindow; | 66 class BrowserWindow; |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 BrowserLiveTabContext* live_tab_context() { return live_tab_context_.get(); } | 275 BrowserLiveTabContext* live_tab_context() { return live_tab_context_.get(); } |
| 273 BrowserSyncedWindowDelegate* synced_window_delegate() { | 276 BrowserSyncedWindowDelegate* synced_window_delegate() { |
| 274 return synced_window_delegate_.get(); | 277 return synced_window_delegate_.get(); |
| 275 } | 278 } |
| 276 BrowserInstantController* instant_controller() { | 279 BrowserInstantController* instant_controller() { |
| 277 return instant_controller_.get(); | 280 return instant_controller_.get(); |
| 278 } | 281 } |
| 279 extensions::HostedAppBrowserController* hosted_app_controller() { | 282 extensions::HostedAppBrowserController* hosted_app_controller() { |
| 280 return hosted_app_controller_.get(); | 283 return hosted_app_controller_.get(); |
| 281 } | 284 } |
| 285 |
| 286 #if !defined(OS_CHROMEOS) |
| 282 SigninViewController* signin_view_controller() { | 287 SigninViewController* signin_view_controller() { |
| 283 return &signin_view_controller_; | 288 return &signin_view_controller_; |
| 284 } | 289 } |
| 290 #endif |
| 285 | 291 |
| 286 // Will lazy create the bubble manager. | 292 // Will lazy create the bubble manager. |
| 287 ChromeBubbleManager* GetBubbleManager(); | 293 ChromeBubbleManager* GetBubbleManager(); |
| 288 | 294 |
| 289 // Get the FindBarController for this browser, creating it if it does not | 295 // Get the FindBarController for this browser, creating it if it does not |
| 290 // yet exist. | 296 // yet exist. |
| 291 FindBarController* GetFindBarController(); | 297 FindBarController* GetFindBarController(); |
| 292 | 298 |
| 293 // Returns true if a FindBarController exists for this browser. | 299 // Returns true if a FindBarController exists for this browser. |
| 294 bool HasFindBarController() const; | 300 bool HasFindBarController() const; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 | 417 |
| 412 ///////////////////////////////////////////////////////////////////////////// | 418 ///////////////////////////////////////////////////////////////////////////// |
| 413 | 419 |
| 414 // Called by chrome::Navigate() when a navigation has occurred in a tab in | 420 // Called by chrome::Navigate() when a navigation has occurred in a tab in |
| 415 // this Browser. Updates the UI for the start of this navigation. | 421 // this Browser. Updates the UI for the start of this navigation. |
| 416 void UpdateUIForNavigationInTab(content::WebContents* contents, | 422 void UpdateUIForNavigationInTab(content::WebContents* contents, |
| 417 ui::PageTransition transition, | 423 ui::PageTransition transition, |
| 418 chrome::NavigateParams::WindowAction action, | 424 chrome::NavigateParams::WindowAction action, |
| 419 bool user_initiated); | 425 bool user_initiated); |
| 420 | 426 |
| 421 // Shows the signin flow for |mode| in a tab-modal dialog. | |
| 422 // |access_point| indicates the access point used to open the Gaia sign in | |
| 423 // page. | |
| 424 void ShowModalSigninWindow(profiles::BubbleViewMode mode, | |
| 425 signin_metrics::AccessPoint access_point); | |
| 426 | |
| 427 // Closes the tab-modal signin flow opened with ShowModalSigninWindow, if it's | |
| 428 // open. Does nothing otherwise. | |
| 429 void CloseModalSigninWindow(); | |
| 430 | |
| 431 // Shows the tab modal sync confirmation dialog that informs the user about | |
| 432 // sync and gives them a chance to abort signin under the tab modal signin | |
| 433 // flow. | |
| 434 void ShowModalSyncConfirmationWindow(); | |
| 435 | |
| 436 // Shows the tab modal signin error dialog that informs the user about | |
| 437 // signin errors. | |
| 438 void ShowModalSigninErrorWindow(); | |
| 439 | |
| 440 // Used to register a KeepAlive to affect the Chrome lifetime. The KeepAlive | 427 // Used to register a KeepAlive to affect the Chrome lifetime. The KeepAlive |
| 441 // is registered when the browser is added to the browser list, and unregisted | 428 // is registered when the browser is added to the browser list, and unregisted |
| 442 // when it is removed from it. | 429 // when it is removed from it. |
| 443 void RegisterKeepAlive(); | 430 void RegisterKeepAlive(); |
| 444 void UnregisterKeepAlive(); | 431 void UnregisterKeepAlive(); |
| 445 | 432 |
| 446 // Interface implementations //////////////////////////////////////////////// | 433 // Interface implementations //////////////////////////////////////////////// |
| 447 | 434 |
| 448 // Overridden from content::PageNavigator: | 435 // Overridden from content::PageNavigator: |
| 449 content::WebContents* OpenURL(const content::OpenURLParams& params) override; | 436 content::WebContents* OpenURL(const content::OpenURLParams& params) override; |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1007 | 994 |
| 1008 std::unique_ptr<extensions::WindowController> extension_window_controller_; | 995 std::unique_ptr<extensions::WindowController> extension_window_controller_; |
| 1009 | 996 |
| 1010 std::unique_ptr<chrome::BrowserCommandController> command_controller_; | 997 std::unique_ptr<chrome::BrowserCommandController> command_controller_; |
| 1011 | 998 |
| 1012 // True if the browser window has been shown at least once. | 999 // True if the browser window has been shown at least once. |
| 1013 bool window_has_shown_; | 1000 bool window_has_shown_; |
| 1014 | 1001 |
| 1015 base::WeakPtr<ValidationMessageBubble> validation_message_bubble_; | 1002 base::WeakPtr<ValidationMessageBubble> validation_message_bubble_; |
| 1016 | 1003 |
| 1004 #if !defined(OS_CHROMEOS) |
| 1017 SigninViewController signin_view_controller_; | 1005 SigninViewController signin_view_controller_; |
| 1006 #endif |
| 1018 | 1007 |
| 1019 std::unique_ptr<ScopedKeepAlive> keep_alive_; | 1008 std::unique_ptr<ScopedKeepAlive> keep_alive_; |
| 1020 | 1009 |
| 1021 // The following factory is used for chrome update coalescing. | 1010 // The following factory is used for chrome update coalescing. |
| 1022 base::WeakPtrFactory<Browser> chrome_updater_factory_; | 1011 base::WeakPtrFactory<Browser> chrome_updater_factory_; |
| 1023 | 1012 |
| 1024 // The following factory is used to close the frame at a later time. | 1013 // The following factory is used to close the frame at a later time. |
| 1025 base::WeakPtrFactory<Browser> weak_factory_; | 1014 base::WeakPtrFactory<Browser> weak_factory_; |
| 1026 | 1015 |
| 1027 DISALLOW_COPY_AND_ASSIGN(Browser); | 1016 DISALLOW_COPY_AND_ASSIGN(Browser); |
| 1028 }; | 1017 }; |
| 1029 | 1018 |
| 1030 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 1019 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
| OLD | NEW |