Chromium Code Reviews| 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/scoped_observer.h" | 20 #include "base/scoped_observer.h" |
| 21 #include "base/strings/string16.h" | 21 #include "base/strings/string16.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/chrome_bubble_manager.h" | |
| 26 #include "chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h" | 27 #include "chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h" |
| 27 #include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h" | 28 #include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h" |
| 28 #include "chrome/browser/ui/host_desktop.h" | 29 #include "chrome/browser/ui/host_desktop.h" |
| 29 #include "chrome/browser/ui/search/search_tab_helper_delegate.h" | 30 #include "chrome/browser/ui/search/search_tab_helper_delegate.h" |
| 30 #include "chrome/browser/ui/search_engines/search_engine_tab_helper_delegate.h" | 31 #include "chrome/browser/ui/search_engines/search_engine_tab_helper_delegate.h" |
| 31 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" | 32 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" |
| 32 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 33 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
| 33 #include "components/content_settings/core/common/content_settings.h" | 34 #include "components/content_settings/core/common/content_settings.h" |
| 34 #include "components/content_settings/core/common/content_settings_types.h" | 35 #include "components/content_settings/core/common/content_settings_types.h" |
| 35 #include "components/sessions/session_id.h" | 36 #include "components/sessions/session_id.h" |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 240 | 241 |
| 241 Type type() const { return type_; } | 242 Type type() const { return type_; } |
| 242 const std::string& app_name() const { return app_name_; } | 243 const std::string& app_name() const { return app_name_; } |
| 243 bool is_trusted_source() const { return is_trusted_source_; } | 244 bool is_trusted_source() const { return is_trusted_source_; } |
| 244 Profile* profile() const { return profile_; } | 245 Profile* profile() const { return profile_; } |
| 245 gfx::Rect override_bounds() const { return override_bounds_; } | 246 gfx::Rect override_bounds() const { return override_bounds_; } |
| 246 | 247 |
| 247 // |window()| will return NULL if called before |CreateBrowserWindow()| | 248 // |window()| will return NULL if called before |CreateBrowserWindow()| |
| 248 // is done. | 249 // is done. |
| 249 BrowserWindow* window() const { return window_; } | 250 BrowserWindow* window() const { return window_; } |
| 251 base::WeakPtr<ChromeBubbleManager> bubble_manager() { | |
|
msw
2015/08/18 17:26:18
Should this be a raw pointer? None of the callers
msw
2015/08/18 17:26:19
nit: order this below more vital/prominent members
hcarmona
2015/08/18 23:08:47
Done.
hcarmona
2015/08/18 23:08:47
Done.
| |
| 252 return bubble_manager_.AsWeakPtr(); | |
| 253 } | |
| 250 ToolbarModel* toolbar_model() { return toolbar_model_.get(); } | 254 ToolbarModel* toolbar_model() { return toolbar_model_.get(); } |
| 251 const ToolbarModel* toolbar_model() const { return toolbar_model_.get(); } | 255 const ToolbarModel* toolbar_model() const { return toolbar_model_.get(); } |
| 252 #if defined(UNIT_TEST) | 256 #if defined(UNIT_TEST) |
| 253 void swap_toolbar_models(scoped_ptr<ToolbarModel>* toolbar_model) { | 257 void swap_toolbar_models(scoped_ptr<ToolbarModel>* toolbar_model) { |
| 254 toolbar_model->swap(toolbar_model_); | 258 toolbar_model->swap(toolbar_model_); |
| 255 } | 259 } |
| 256 #endif | 260 #endif |
| 257 TabStripModel* tab_strip_model() const { return tab_strip_model_.get(); } | 261 TabStripModel* tab_strip_model() const { return tab_strip_model_.get(); } |
| 258 chrome::BrowserCommandController* command_controller() { | 262 chrome::BrowserCommandController* command_controller() { |
| 259 return command_controller_.get(); | 263 return command_controller_.get(); |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 846 | 850 |
| 847 // This Browser's type. | 851 // This Browser's type. |
| 848 const Type type_; | 852 const Type type_; |
| 849 | 853 |
| 850 // This Browser's profile. | 854 // This Browser's profile. |
| 851 Profile* const profile_; | 855 Profile* const profile_; |
| 852 | 856 |
| 853 // This Browser's window. | 857 // This Browser's window. |
| 854 BrowserWindow* window_; | 858 BrowserWindow* window_; |
| 855 | 859 |
| 860 ChromeBubbleManager bubble_manager_; | |
|
msw
2015/08/18 17:26:19
ditto nit: order lower.
msw
2015/08/18 17:26:19
nit: should this be created lazily? (it won't alwa
hcarmona
2015/08/18 23:08:47
Done.
hcarmona
2015/08/18 23:08:47
Done.
| |
| 861 | |
| 856 scoped_ptr<TabStripModelDelegate> tab_strip_model_delegate_; | 862 scoped_ptr<TabStripModelDelegate> tab_strip_model_delegate_; |
| 857 scoped_ptr<TabStripModel> tab_strip_model_; | 863 scoped_ptr<TabStripModel> tab_strip_model_; |
| 858 | 864 |
| 859 // The application name that is also the name of the window to the shell. | 865 // The application name that is also the name of the window to the shell. |
| 860 // This name should be set when: | 866 // This name should be set when: |
| 861 // 1) we launch an application via an application shortcut or extension API. | 867 // 1) we launch an application via an application shortcut or extension API. |
| 862 // 2) we launch an undocked devtool window. | 868 // 2) we launch an undocked devtool window. |
| 863 std::string app_name_; | 869 std::string app_name_; |
| 864 | 870 |
| 865 // True if the source is trusted (i.e. we do not need to show the URL in a | 871 // True if the source is trusted (i.e. we do not need to show the URL in a |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 972 // The following factory is used for chrome update coalescing. | 978 // The following factory is used for chrome update coalescing. |
| 973 base::WeakPtrFactory<Browser> chrome_updater_factory_; | 979 base::WeakPtrFactory<Browser> chrome_updater_factory_; |
| 974 | 980 |
| 975 // The following factory is used to close the frame at a later time. | 981 // The following factory is used to close the frame at a later time. |
| 976 base::WeakPtrFactory<Browser> weak_factory_; | 982 base::WeakPtrFactory<Browser> weak_factory_; |
| 977 | 983 |
| 978 DISALLOW_COPY_AND_ASSIGN(Browser); | 984 DISALLOW_COPY_AND_ASSIGN(Browser); |
| 979 }; | 985 }; |
| 980 | 986 |
| 981 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 987 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
| OLD | NEW |