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

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

Issue 10699057: Move application creation and extension install prompt showing off Browser and onto ExtensionTabHel… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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
« no previous file with comments | « chrome/browser/infobars/infobars_browsertest.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/basictypes.h" 14 #include "base/basictypes.h"
15 #include "base/compiler_specific.h" 15 #include "base/compiler_specific.h"
16 #include "base/gtest_prod_util.h" 16 #include "base/gtest_prod_util.h"
17 #include "base/memory/scoped_ptr.h" 17 #include "base/memory/scoped_ptr.h"
18 #include "base/memory/weak_ptr.h" 18 #include "base/memory/weak_ptr.h"
19 #include "base/string16.h" 19 #include "base/string16.h"
20 #include "chrome/browser/debugger/devtools_toggle_action.h" 20 #include "chrome/browser/debugger/devtools_toggle_action.h"
21 #include "chrome/browser/event_disposition.h" 21 #include "chrome/browser/event_disposition.h"
22 #include "chrome/browser/extensions/extension_tab_helper_delegate.h"
23 #include "chrome/browser/instant/instant_controller_delegate.h" 22 #include "chrome/browser/instant/instant_controller_delegate.h"
24 #include "chrome/browser/intents/device_attached_intent_source.h" 23 #include "chrome/browser/intents/device_attached_intent_source.h"
25 #include "chrome/browser/prefs/pref_change_registrar.h" 24 #include "chrome/browser/prefs/pref_change_registrar.h"
26 #include "chrome/browser/prefs/pref_member.h" 25 #include "chrome/browser/prefs/pref_member.h"
27 #include "chrome/browser/sessions/session_id.h" 26 #include "chrome/browser/sessions/session_id.h"
28 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate. h" 27 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate. h"
29 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" 28 #include "chrome/browser/ui/bookmarks/bookmark_bar.h"
30 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper_delegate.h" 29 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper_delegate.h"
31 #include "chrome/browser/ui/browser_navigator.h" 30 #include "chrome/browser/ui/browser_navigator.h"
32 #include "chrome/browser/ui/constrained_window_tab_helper_delegate.h" 31 #include "chrome/browser/ui/constrained_window_tab_helper_delegate.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 97
99 class Browser : public TabStripModelDelegate, 98 class Browser : public TabStripModelDelegate,
100 public TabStripModelObserver, 99 public TabStripModelObserver,
101 public content::WebContentsDelegate, 100 public content::WebContentsDelegate,
102 public CoreTabHelperDelegate, 101 public CoreTabHelperDelegate,
103 public SearchEngineTabHelperDelegate, 102 public SearchEngineTabHelperDelegate,
104 public ConstrainedWindowTabHelperDelegate, 103 public ConstrainedWindowTabHelperDelegate,
105 public BlockedContentTabHelperDelegate, 104 public BlockedContentTabHelperDelegate,
106 public BookmarkTabHelperDelegate, 105 public BookmarkTabHelperDelegate,
107 public ZoomObserver, 106 public ZoomObserver,
108 public ExtensionTabHelperDelegate,
109 public content::PageNavigator, 107 public content::PageNavigator,
110 public content::NotificationObserver, 108 public content::NotificationObserver,
111 public SelectFileDialog::Listener, 109 public SelectFileDialog::Listener,
112 public InstantControllerDelegate { 110 public InstantControllerDelegate {
113 public: 111 public:
114 // SessionService::WindowType mirrors these values. If you add to this 112 // SessionService::WindowType mirrors these values. If you add to this
115 // enum, look at SessionService::WindowType to see if it needs to be 113 // enum, look at SessionService::WindowType to see if it needs to be
116 // updated. 114 // updated.
117 enum Type { 115 enum Type {
118 // If you add a new type, consider updating the test 116 // If you add a new type, consider updating the test
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 151
154 // The browser is shutting down and there are active downloads 152 // The browser is shutting down and there are active downloads
155 // that would be cancelled. 153 // that would be cancelled.
156 DOWNLOAD_CLOSE_BROWSER_SHUTDOWN, 154 DOWNLOAD_CLOSE_BROWSER_SHUTDOWN,
157 155
158 // There are active downloads associated with this incognito profile 156 // There are active downloads associated with this incognito profile
159 // that would be canceled. 157 // that would be canceled.
160 DOWNLOAD_CLOSE_LAST_WINDOW_IN_INCOGNITO_PROFILE, 158 DOWNLOAD_CLOSE_LAST_WINDOW_IN_INCOGNITO_PROFILE,
161 }; 159 };
162 160
163 // Different types of action when web app info is available.
164 // OnDidGetApplicationInfo uses this to dispatch calls.
165 enum WebAppAction {
166 NONE, // No action at all.
167 CREATE_SHORTCUT, // Bring up create application shortcut dialog.
168 UPDATE_SHORTCUT // Update icon for app shortcut.
169 };
170
171 struct CreateParams { 161 struct CreateParams {
172 CreateParams(); 162 CreateParams();
173 CreateParams(Type type, Profile* profile); 163 CreateParams(Type type, Profile* profile);
174 164
175 static CreateParams CreateForApp(Type type, 165 static CreateParams CreateForApp(Type type,
176 const std::string& app_name, 166 const std::string& app_name,
177 const gfx::Rect& window_bounds, 167 const gfx::Rect& window_bounds,
178 Profile* profile); 168 Profile* profile);
179 169
180 static CreateParams CreateForDevTools(Profile* profile); 170 static CreateParams CreateForDevTools(Profile* profile);
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 // in |SupportsWindowFeature| for details on this. 376 // in |SupportsWindowFeature| for details on this.
387 bool CanSupportWindowFeature(WindowFeature feature) const; 377 bool CanSupportWindowFeature(WindowFeature feature) const;
388 378
389 // TODO(port): port these, and re-merge the two function declaration lists. 379 // TODO(port): port these, and re-merge the two function declaration lists.
390 // Page-related commands. 380 // Page-related commands.
391 void ToggleEncodingAutoDetect(); 381 void ToggleEncodingAutoDetect();
392 void OverrideEncoding(int encoding_id); 382 void OverrideEncoding(int encoding_id);
393 383
394 // Show various bits of UI 384 // Show various bits of UI
395 void OpenFile(); 385 void OpenFile();
396 void OpenCreateShortcutsDialog();
397 386
398 void UpdateDownloadShelfVisibility(bool visible); 387 void UpdateDownloadShelfVisibility(bool visible);
399 388
400 // Commits the current instant, returning true on success. This is intended 389 // Commits the current instant, returning true on success. This is intended
401 // for use from OpenCurrentURL. 390 // for use from OpenCurrentURL.
402 bool OpenInstant(WindowOpenDisposition disposition); 391 bool OpenInstant(WindowOpenDisposition disposition);
403 392
404 ///////////////////////////////////////////////////////////////////////////// 393 /////////////////////////////////////////////////////////////////////////////
405 394
406 // Helper function to run unload listeners on a WebContents. 395 // Helper function to run unload listeners on a WebContents.
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 514
526 // True when the mouse cursor is locked. 515 // True when the mouse cursor is locked.
527 bool IsMouseLocked() const; 516 bool IsMouseLocked() const;
528 517
529 // Called each time the browser window is shown. 518 // Called each time the browser window is shown.
530 void OnWindowDidShow(); 519 void OnWindowDidShow();
531 520
532 // Show the first run search engine bubble on the location bar. 521 // Show the first run search engine bubble on the location bar.
533 void ShowFirstRunBubble(); 522 void ShowFirstRunBubble();
534 523
535 void set_pending_web_app_action(WebAppAction action) {
536 pending_web_app_action_ = action;
537 }
538
539 ExtensionWindowController* extension_window_controller() const { 524 ExtensionWindowController* extension_window_controller() const {
540 return extension_window_controller_.get(); 525 return extension_window_controller_.get();
541 } 526 }
542 527
543 protected: 528 protected:
544 // Funnel for the factory method in BrowserWindow. This allows subclasses to 529 // Funnel for the factory method in BrowserWindow. This allows subclasses to
545 // set their own window. 530 // set their own window.
546 virtual BrowserWindow* CreateBrowserWindow(); 531 virtual BrowserWindow* CreateBrowserWindow();
547 532
548 private: 533 private:
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 virtual void URLStarredChanged(TabContents* source, 717 virtual void URLStarredChanged(TabContents* source,
733 bool starred) OVERRIDE; 718 bool starred) OVERRIDE;
734 719
735 // Overridden from ZoomObserver: 720 // Overridden from ZoomObserver:
736 virtual void OnZoomIconChanged(TabContents* source, 721 virtual void OnZoomIconChanged(TabContents* source,
737 ZoomController::ZoomIconState state) OVERRIDE; 722 ZoomController::ZoomIconState state) OVERRIDE;
738 virtual void OnZoomChanged(TabContents* source, 723 virtual void OnZoomChanged(TabContents* source,
739 int zoom_percent, 724 int zoom_percent,
740 bool can_show_bubble) OVERRIDE; 725 bool can_show_bubble) OVERRIDE;
741 726
742 // Overridden from ExtensionTabHelperDelegate:
743 virtual void OnDidGetApplicationInfo(TabContents* source,
744 int32 page_id) OVERRIDE;
745 virtual void OnInstallApplication(
746 TabContents* source,
747 const WebApplicationInfo& app_info) OVERRIDE;
748
749 // Overridden from SelectFileDialog::Listener: 727 // Overridden from SelectFileDialog::Listener:
750 virtual void FileSelected(const FilePath& path, 728 virtual void FileSelected(const FilePath& path,
751 int index, 729 int index,
752 void* params) OVERRIDE; 730 void* params) OVERRIDE;
753 731
754 // Overridden from content::NotificationObserver: 732 // Overridden from content::NotificationObserver:
755 virtual void Observe(int type, 733 virtual void Observe(int type,
756 const content::NotificationSource& source, 734 const content::NotificationSource& source,
757 const content::NotificationDetails& details) OVERRIDE; 735 const content::NotificationDetails& details) OVERRIDE;
758 736
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 // The Find Bar. This may be NULL if there is no Find Bar, and if it is 982 // The Find Bar. This may be NULL if there is no Find Bar, and if it is
1005 // non-NULL, it may or may not be visible. 983 // non-NULL, it may or may not be visible.
1006 scoped_ptr<FindBarController> find_bar_controller_; 984 scoped_ptr<FindBarController> find_bar_controller_;
1007 985
1008 // Dialog box used for opening and saving files. 986 // Dialog box used for opening and saving files.
1009 scoped_refptr<SelectFileDialog> select_file_dialog_; 987 scoped_refptr<SelectFileDialog> select_file_dialog_;
1010 988
1011 // Keep track of the encoding auto detect pref. 989 // Keep track of the encoding auto detect pref.
1012 BooleanPrefMember encoding_auto_detect_; 990 BooleanPrefMember encoding_auto_detect_;
1013 991
1014 // Which deferred action to perform when OnDidGetApplicationInfo is notified
1015 // from a WebContents. Currently, only one pending action is allowed.
1016 WebAppAction pending_web_app_action_;
1017
1018 // Helper which implements the ContentSettingBubbleModel interface. 992 // Helper which implements the ContentSettingBubbleModel interface.
1019 scoped_ptr<BrowserContentSettingBubbleModelDelegate> 993 scoped_ptr<BrowserContentSettingBubbleModelDelegate>
1020 content_setting_bubble_model_delegate_; 994 content_setting_bubble_model_delegate_;
1021 995
1022 // Helper which implements the ToolbarModelDelegate interface. 996 // Helper which implements the ToolbarModelDelegate interface.
1023 scoped_ptr<BrowserToolbarModelDelegate> toolbar_model_delegate_; 997 scoped_ptr<BrowserToolbarModelDelegate> toolbar_model_delegate_;
1024 998
1025 // A delegate that handles the details of updating the "active" 999 // A delegate that handles the details of updating the "active"
1026 // |search_model_| state with the tab's state. 1000 // |search_model_| state with the tab's state.
1027 scoped_ptr<chrome::search::SearchDelegate> search_delegate_; 1001 scoped_ptr<chrome::search::SearchDelegate> search_delegate_;
(...skipping 20 matching lines...) Expand all
1048 bool window_has_shown_; 1022 bool window_has_shown_;
1049 1023
1050 // Currently open color chooser. Non-NULL after OpenColorChooser is called and 1024 // Currently open color chooser. Non-NULL after OpenColorChooser is called and
1051 // before DidEndColorChooser is called. 1025 // before DidEndColorChooser is called.
1052 scoped_ptr<content::ColorChooser> color_chooser_; 1026 scoped_ptr<content::ColorChooser> color_chooser_;
1053 1027
1054 DISALLOW_COPY_AND_ASSIGN(Browser); 1028 DISALLOW_COPY_AND_ASSIGN(Browser);
1055 }; 1029 };
1056 1030
1057 #endif // CHROME_BROWSER_UI_BROWSER_H_ 1031 #endif // CHROME_BROWSER_UI_BROWSER_H_
OLDNEW
« no previous file with comments | « chrome/browser/infobars/infobars_browsertest.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698