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