Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(563)

Side by Side Diff: chrome/browser/ui/browser.h

Issue 9479008: Re-factor location bar/toolbar code to get rid of the browser dependency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments fix Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "chrome/common/content_settings_types.h" 45 #include "chrome/common/content_settings_types.h"
46 #include "chrome/common/extensions/extension_constants.h" 46 #include "chrome/common/extensions/extension_constants.h"
47 #include "content/public/browser/notification_registrar.h" 47 #include "content/public/browser/notification_registrar.h"
48 #include "content/public/browser/page_navigator.h" 48 #include "content/public/browser/page_navigator.h"
49 #include "content/public/browser/web_contents_delegate.h" 49 #include "content/public/browser/web_contents_delegate.h"
50 #include "content/public/common/page_transition_types.h" 50 #include "content/public/common/page_transition_types.h"
51 #include "content/public/common/page_zoom.h" 51 #include "content/public/common/page_zoom.h"
52 #include "ui/base/ui_base_types.h" 52 #include "ui/base/ui_base_types.h"
53 #include "ui/gfx/rect.h" 53 #include "ui/gfx/rect.h"
54 54
55 class BrowserContentSettingBubbleModelDelegate;
55 class BrowserSyncedWindowDelegate; 56 class BrowserSyncedWindowDelegate;
57 class BrowserTabContentsWrapperContainer;
56 class BrowserTabRestoreServiceDelegate; 58 class BrowserTabRestoreServiceDelegate;
57 class BrowserWindow; 59 class BrowserWindow;
58 class Extension; 60 class Extension;
59 class ExtensionWindowController; 61 class ExtensionWindowController;
60 class FindBarController; 62 class FindBarController;
61 class FullscreenController; 63 class FullscreenController;
62 class HtmlDialogUIDelegate; 64 class HtmlDialogUIDelegate;
63 class InstantController; 65 class InstantController;
64 class InstantUnloadHandler; 66 class InstantUnloadHandler;
65 class PrefService; 67 class PrefService;
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 Profile* profile() const { return profile_; } 229 Profile* profile() const { return profile_; }
228 gfx::Rect override_bounds() const { return override_bounds_; } 230 gfx::Rect override_bounds() const { return override_bounds_; }
229 231
230 // Returns the InstantController or NULL if there is no InstantController for 232 // Returns the InstantController or NULL if there is no InstantController for
231 // this Browser. 233 // this Browser.
232 InstantController* instant() const { return instant_.get(); } 234 InstantController* instant() const { return instant_.get(); }
233 235
234 // |window()| will return NULL if called before |CreateBrowserWindow()| 236 // |window()| will return NULL if called before |CreateBrowserWindow()|
235 // is done. 237 // is done.
236 BrowserWindow* window() const { return window_; } 238 BrowserWindow* window() const { return window_; }
237 ToolbarModel* toolbar_model() { return &toolbar_model_; } 239 ToolbarModel* toolbar_model() { return toolbar_model_.get(); }
238 const SessionID& session_id() const { return session_id_; } 240 const SessionID& session_id() const { return session_id_; }
239 CommandUpdater* command_updater() { return &command_updater_; } 241 CommandUpdater* command_updater() { return &command_updater_; }
240 bool block_command_execution() const { return block_command_execution_; } 242 bool block_command_execution() const { return block_command_execution_; }
243 BrowserContentSettingBubbleModelDelegate*
244 content_setting_bubble_model_delegate() {
245 return content_setting_bubble_model_delegate_.get();
246 }
247 BrowserTabContentsWrapperContainer* tab_contents_wrapper_container() {
248 return tab_contents_wrapper_container_.get();
249 }
241 BrowserTabRestoreServiceDelegate* tab_restore_service_delegate() { 250 BrowserTabRestoreServiceDelegate* tab_restore_service_delegate() {
242 return tab_restore_service_delegate_.get(); 251 return tab_restore_service_delegate_.get();
243 } 252 }
244 BrowserSyncedWindowDelegate* synced_window_delegate() { 253 BrowserSyncedWindowDelegate* synced_window_delegate() {
245 return synced_window_delegate_.get(); 254 return synced_window_delegate_.get();
246 } 255 }
247 256
248 // Get the FindBarController for this browser, creating it if it does not 257 // Get the FindBarController for this browser, creating it if it does not
249 // yet exist. 258 // yet exist.
250 FindBarController* GetFindBarController(); 259 FindBarController* GetFindBarController();
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1354 // 1) we launch an application via an application shortcut or extension API. 1363 // 1) we launch an application via an application shortcut or extension API.
1355 // 2) we launch an undocked devtool window. 1364 // 2) we launch an undocked devtool window.
1356 std::string app_name_; 1365 std::string app_name_;
1357 1366
1358 // Unique identifier of this browser for session restore. This id is only 1367 // Unique identifier of this browser for session restore. This id is only
1359 // unique within the current session, and is not guaranteed to be unique 1368 // unique within the current session, and is not guaranteed to be unique
1360 // across sessions. 1369 // across sessions.
1361 const SessionID session_id_; 1370 const SessionID session_id_;
1362 1371
1363 // The model for the toolbar view. 1372 // The model for the toolbar view.
1364 ToolbarModel toolbar_model_; 1373 scoped_ptr<ToolbarModel> toolbar_model_;
1365 1374
1366 // UI update coalescing and handling //////////////////////////////////////// 1375 // UI update coalescing and handling ////////////////////////////////////////
1367 1376
1368 typedef std::map<const content::WebContents*, int> UpdateMap; 1377 typedef std::map<const content::WebContents*, int> UpdateMap;
1369 1378
1370 // Maps from TabContents to pending UI updates that need to be processed. 1379 // Maps from TabContents to pending UI updates that need to be processed.
1371 // We don't update things like the URL or tab title right away to avoid 1380 // We don't update things like the URL or tab title right away to avoid
1372 // flickering and extra painting. 1381 // flickering and extra painting.
1373 // See ScheduleUIUpdate and ProcessPendingUIUpdates. 1382 // See ScheduleUIUpdate and ProcessPendingUIUpdates.
1374 UpdateMap scheduled_updates_; 1383 UpdateMap scheduled_updates_;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1448 }; 1457 };
1449 1458
1450 // Which deferred action to perform when OnDidGetApplicationInfo is notified 1459 // Which deferred action to perform when OnDidGetApplicationInfo is notified
1451 // from a TabContents. Currently, only one pending action is allowed. 1460 // from a TabContents. Currently, only one pending action is allowed.
1452 WebAppAction pending_web_app_action_; 1461 WebAppAction pending_web_app_action_;
1453 1462
1454 // The profile's tab restore service. The service is owned by the profile, 1463 // The profile's tab restore service. The service is owned by the profile,
1455 // and we install ourselves as an observer. 1464 // and we install ourselves as an observer.
1456 TabRestoreService* tab_restore_service_; 1465 TabRestoreService* tab_restore_service_;
1457 1466
1467 // Helper which implements the ContentSettingBubbleModel interface.
1468 scoped_ptr<BrowserContentSettingBubbleModelDelegate>
1469 content_setting_bubble_model_delegate_;
1470
1471 // Helper which implements the TabContentsWrapperContainer interface.
1472 scoped_ptr<BrowserTabContentsWrapperContainer>
1473 tab_contents_wrapper_container_;
1474
1458 // Helper which implements the TabRestoreServiceDelegate interface. 1475 // Helper which implements the TabRestoreServiceDelegate interface.
1459 scoped_ptr<BrowserTabRestoreServiceDelegate> tab_restore_service_delegate_; 1476 scoped_ptr<BrowserTabRestoreServiceDelegate> tab_restore_service_delegate_;
1460 1477
1461 // Helper which implements the SyncedWindowDelegate interface. 1478 // Helper which implements the SyncedWindowDelegate interface.
1462 scoped_ptr<BrowserSyncedWindowDelegate> synced_window_delegate_; 1479 scoped_ptr<BrowserSyncedWindowDelegate> synced_window_delegate_;
1463 1480
1464 scoped_ptr<InstantController> instant_; 1481 scoped_ptr<InstantController> instant_;
1465 scoped_ptr<InstantUnloadHandler> instant_unload_handler_; 1482 scoped_ptr<InstantUnloadHandler> instant_unload_handler_;
1466 1483
1467 BookmarkBar::State bookmark_bar_state_; 1484 BookmarkBar::State bookmark_bar_state_;
1468 1485
1469 scoped_refptr<FullscreenController> fullscreen_controller_; 1486 scoped_refptr<FullscreenController> fullscreen_controller_;
1470 1487
1471 scoped_ptr<ExtensionWindowController> extension_window_controller_; 1488 scoped_ptr<ExtensionWindowController> extension_window_controller_;
1472 1489
1473 // True if the browser window has been shown at least once. 1490 // True if the browser window has been shown at least once.
1474 bool window_has_shown_; 1491 bool window_has_shown_;
1475 1492
1476 DISALLOW_COPY_AND_ASSIGN(Browser); 1493 DISALLOW_COPY_AND_ASSIGN(Browser);
1477 }; 1494 };
1478 1495
1479 #endif // CHROME_BROWSER_UI_BROWSER_H_ 1496 #endif // CHROME_BROWSER_UI_BROWSER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/browser.cc » ('j') | chrome/browser/ui/content_settings/content_setting_bubble_model.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698