| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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_BROWSER_H_ | 5 #ifndef CHROME_BROWSER_BROWSER_H_ |
| 6 #define CHROME_BROWSER_BROWSER_H_ | 6 #define CHROME_BROWSER_BROWSER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/gfx/rect.h" | 12 #include "base/gfx/rect.h" |
| 13 #include "base/scoped_ptr.h" | 13 #include "base/scoped_ptr.h" |
| 14 #include "base/task.h" | 14 #include "base/task.h" |
| 15 #include "chrome/browser/command_updater.h" | 15 #include "chrome/browser/command_updater.h" |
| 16 #include "chrome/browser/extensions/extension_function_dispatcher.h" | |
| 17 #include "chrome/browser/sessions/session_id.h" | 16 #include "chrome/browser/sessions/session_id.h" |
| 18 #include "chrome/browser/shell_dialogs.h" | 17 #include "chrome/browser/shell_dialogs.h" |
| 19 #include "chrome/browser/tabs/tab_strip_model.h" | 18 #include "chrome/browser/tabs/tab_strip_model.h" |
| 20 #include "chrome/browser/tab_contents/page_navigator.h" | 19 #include "chrome/browser/tab_contents/page_navigator.h" |
| 21 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 20 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
| 22 #include "chrome/browser/toolbar_model.h" | 21 #include "chrome/browser/toolbar_model.h" |
| 23 #include "chrome/common/notification_registrar.h" | 22 #include "chrome/common/notification_registrar.h" |
| 24 #include "chrome/common/pref_member.h" | 23 #include "chrome/common/pref_member.h" |
| 25 #include "testing/gtest/include/gtest/gtest_prod.h" | 24 #include "testing/gtest/include/gtest/gtest_prod.h" |
| 26 | 25 |
| 27 class BrowserIdleTimer; | 26 class BrowserIdleTimer; |
| 28 class BrowserWindow; | 27 class BrowserWindow; |
| 29 class DebuggerWindow; | 28 class DebuggerWindow; |
| 30 class FindBarController; | 29 class FindBarController; |
| 31 class GoButton; | 30 class GoButton; |
| 32 class LocationBar; | 31 class LocationBar; |
| 33 class PrefService; | 32 class PrefService; |
| 34 class Profile; | 33 class Profile; |
| 35 class SkBitmap; | 34 class SkBitmap; |
| 36 class StatusBubble; | 35 class StatusBubble; |
| 37 class TabNavigation; | 36 class TabNavigation; |
| 38 | 37 |
| 39 class Browser : public TabStripModelDelegate, | 38 class Browser : public TabStripModelDelegate, |
| 40 public TabStripModelObserver, | 39 public TabStripModelObserver, |
| 41 public TabContentsDelegate, | 40 public TabContentsDelegate, |
| 42 public PageNavigator, | 41 public PageNavigator, |
| 43 public CommandUpdater::CommandUpdaterDelegate, | 42 public CommandUpdater::CommandUpdaterDelegate, |
| 44 public NotificationObserver, | 43 public NotificationObserver, |
| 45 public SelectFileDialog::Listener, | 44 public SelectFileDialog::Listener { |
| 46 public ExtensionFunctionDispatcher::Delegate { | |
| 47 public: | 45 public: |
| 48 enum Type { | 46 enum Type { |
| 49 TYPE_NORMAL = 0, | 47 TYPE_NORMAL = 0, |
| 50 TYPE_POPUP = 1, | 48 TYPE_POPUP = 1, |
| 51 TYPE_APP = 2, | 49 TYPE_APP = 2, |
| 52 TYPE_APP_POPUP = TYPE_APP | TYPE_POPUP, | 50 TYPE_APP_POPUP = TYPE_APP | TYPE_POPUP, |
| 53 }; | 51 }; |
| 54 | 52 |
| 55 // Possible elements of the Browser window. | 53 // Possible elements of the Browser window. |
| 56 enum WindowFeature { | 54 enum WindowFeature { |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 virtual void ConvertContentsToApplication(TabContents* source); | 475 virtual void ConvertContentsToApplication(TabContents* source); |
| 478 virtual bool ShouldDisplayURLField(); | 476 virtual bool ShouldDisplayURLField(); |
| 479 virtual gfx::Rect GetRootWindowResizerRect() const; | 477 virtual gfx::Rect GetRootWindowResizerRect() const; |
| 480 virtual void ShowHtmlDialog(HtmlDialogUIDelegate* delegate, | 478 virtual void ShowHtmlDialog(HtmlDialogUIDelegate* delegate, |
| 481 gfx::NativeWindow parent_window); | 479 gfx::NativeWindow parent_window); |
| 482 virtual void BeforeUnloadFired(TabContents* source, | 480 virtual void BeforeUnloadFired(TabContents* source, |
| 483 bool proceed, | 481 bool proceed, |
| 484 bool* proceed_to_fire_unload); | 482 bool* proceed_to_fire_unload); |
| 485 virtual void SetFocusToLocationBar(); | 483 virtual void SetFocusToLocationBar(); |
| 486 virtual void RenderWidgetShowing(); | 484 virtual void RenderWidgetShowing(); |
| 487 virtual ExtensionFunctionDispatcher* CreateExtensionFunctionDispatcher( | |
| 488 RenderViewHost* render_view_host, | |
| 489 const std::string& extension_id); | |
| 490 virtual int GetExtraRenderViewHeight() const; | 485 virtual int GetExtraRenderViewHeight() const; |
| 491 virtual void OnStartDownload(DownloadItem* download); | 486 virtual void OnStartDownload(DownloadItem* download); |
| 492 virtual void ConfirmAddSearchProvider(const TemplateURL* template_url, | 487 virtual void ConfirmAddSearchProvider(const TemplateURL* template_url, |
| 493 Profile* profile); | 488 Profile* profile); |
| 494 | 489 |
| 495 // Overridden from SelectFileDialog::Listener: | 490 // Overridden from SelectFileDialog::Listener: |
| 496 virtual void FileSelected(const FilePath& path, int index, void* params); | 491 virtual void FileSelected(const FilePath& path, int index, void* params); |
| 497 | 492 |
| 498 // Overridden from NotificationObserver: | 493 // Overridden from NotificationObserver: |
| 499 virtual void Observe(NotificationType type, | 494 virtual void Observe(NotificationType type, |
| 500 const NotificationSource& source, | 495 const NotificationSource& source, |
| 501 const NotificationDetails& details); | 496 const NotificationDetails& details); |
| 502 | 497 |
| 503 // Overridden from ExtensionFunctionDispatcher::Delegate | |
| 504 virtual Browser* GetBrowser() { | |
| 505 return this; | |
| 506 } | |
| 507 | |
| 508 // Command and state updating /////////////////////////////////////////////// | 498 // Command and state updating /////////////////////////////////////////////// |
| 509 | 499 |
| 510 // Initialize state for all browser commands. | 500 // Initialize state for all browser commands. |
| 511 void InitCommandState(); | 501 void InitCommandState(); |
| 512 | 502 |
| 513 // Update commands whose state depends on the tab's state. | 503 // Update commands whose state depends on the tab's state. |
| 514 void UpdateCommandsForTabState(); | 504 void UpdateCommandsForTabState(); |
| 515 | 505 |
| 516 // Update commands whose state depends on whether the window is in fullscreen | 506 // Update commands whose state depends on whether the window is in fullscreen |
| 517 // mode. | 507 // mode. |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 // The browser idle task helps cleanup unused memory resources when idle. | 747 // The browser idle task helps cleanup unused memory resources when idle. |
| 758 scoped_ptr<BrowserIdleTimer> idle_task_; | 748 scoped_ptr<BrowserIdleTimer> idle_task_; |
| 759 | 749 |
| 760 // Keep track of the encoding auto detect pref. | 750 // Keep track of the encoding auto detect pref. |
| 761 BooleanPrefMember encoding_auto_detect_; | 751 BooleanPrefMember encoding_auto_detect_; |
| 762 | 752 |
| 763 DISALLOW_COPY_AND_ASSIGN(Browser); | 753 DISALLOW_COPY_AND_ASSIGN(Browser); |
| 764 }; | 754 }; |
| 765 | 755 |
| 766 #endif // CHROME_BROWSER_BROWSER_H_ | 756 #endif // CHROME_BROWSER_BROWSER_H_ |
| OLD | NEW |