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_shelf_model.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 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 DCHECK(!window_); | 126 DCHECK(!window_); |
128 window_ = window; | 127 window_ = window; |
129 } | 128 } |
130 #endif | 129 #endif |
131 | 130 |
132 BrowserWindow* window() const { return window_; } | 131 BrowserWindow* window() const { return window_; } |
133 ToolbarModel* toolbar_model() { return &toolbar_model_; } | 132 ToolbarModel* toolbar_model() { return &toolbar_model_; } |
134 const SessionID& session_id() const { return session_id_; } | 133 const SessionID& session_id() const { return session_id_; } |
135 CommandUpdater* command_updater() { return &command_updater_; } | 134 CommandUpdater* command_updater() { return &command_updater_; } |
136 FindBarController* find_bar() { return find_bar_controller_.get(); } | 135 FindBarController* find_bar() { return find_bar_controller_.get(); } |
137 ExtensionShelfModel* extension_shelf_model() { | |
138 return extension_shelf_model_.get(); | |
139 } | |
140 | 136 |
141 // Setters ///////////////////////////////////////////////////////////////// | 137 // Setters ///////////////////////////////////////////////////////////////// |
142 | 138 |
143 void set_user_data_dir_profiles(const std::vector<std::wstring>& profiles); | 139 void set_user_data_dir_profiles(const std::vector<std::wstring>& profiles); |
144 | 140 |
145 // Browser Creation Helpers ///////////////////////////////////////////////// | 141 // Browser Creation Helpers ///////////////////////////////////////////////// |
146 | 142 |
147 // Opens a new window with the default blank tab. | 143 // Opens a new window with the default blank tab. |
148 static void OpenEmptyWindow(Profile* profile); | 144 static void OpenEmptyWindow(Profile* profile); |
149 | 145 |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 | 696 |
701 private: | 697 private: |
702 Browser* browser_; | 698 Browser* browser_; |
703 | 699 |
704 DISALLOW_COPY_AND_ASSIGN(BrowserToolbarModel); | 700 DISALLOW_COPY_AND_ASSIGN(BrowserToolbarModel); |
705 }; | 701 }; |
706 | 702 |
707 // The model for the toolbar view. | 703 // The model for the toolbar view. |
708 BrowserToolbarModel toolbar_model_; | 704 BrowserToolbarModel toolbar_model_; |
709 | 705 |
710 // The model for the extension shelf. | |
711 scoped_ptr<ExtensionShelfModel> extension_shelf_model_; | |
712 | |
713 // UI update coalescing and handling //////////////////////////////////////// | 706 // UI update coalescing and handling //////////////////////////////////////// |
714 | 707 |
715 // Tracks invalidates to the UI, see the declaration in the .cc file. | 708 // Tracks invalidates to the UI, see the declaration in the .cc file. |
716 struct UIUpdate; | 709 struct UIUpdate; |
717 typedef std::vector<UIUpdate> UpdateVector; | 710 typedef std::vector<UIUpdate> UpdateVector; |
718 | 711 |
719 // Lists all UI updates that are pending. We don't update things like the | 712 // Lists all UI updates that are pending. We don't update things like the |
720 // URL or tab title right away to avoid flickering and extra painting. | 713 // URL or tab title right away to avoid flickering and extra painting. |
721 // See ScheduleUIUpdate and ProcessPendingUIUpdates. | 714 // See ScheduleUIUpdate and ProcessPendingUIUpdates. |
722 UpdateVector scheduled_updates_; | 715 UpdateVector scheduled_updates_; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 // The browser idle task helps cleanup unused memory resources when idle. | 767 // The browser idle task helps cleanup unused memory resources when idle. |
775 scoped_ptr<BrowserIdleTimer> idle_task_; | 768 scoped_ptr<BrowserIdleTimer> idle_task_; |
776 | 769 |
777 // Keep track of the encoding auto detect pref. | 770 // Keep track of the encoding auto detect pref. |
778 BooleanPrefMember encoding_auto_detect_; | 771 BooleanPrefMember encoding_auto_detect_; |
779 | 772 |
780 DISALLOW_COPY_AND_ASSIGN(Browser); | 773 DISALLOW_COPY_AND_ASSIGN(Browser); |
781 }; | 774 }; |
782 | 775 |
783 #endif // CHROME_BROWSER_BROWSER_H_ | 776 #endif // CHROME_BROWSER_BROWSER_H_ |
OLD | NEW |