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

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

Issue 18093: Changes to insure that when in app-mode, links open in the default browser. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/basictypes.h" 8 #include "base/basictypes.h"
9 9
10 #include <vector> 10 #include <vector>
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 ToolbarModel* toolbar_model() { return &toolbar_model_; } 105 ToolbarModel* toolbar_model() { return &toolbar_model_; }
106 const SessionID& session_id() const { return session_id_; } 106 const SessionID& session_id() const { return session_id_; }
107 CommandUpdater* command_updater() { return &command_updater_; } 107 CommandUpdater* command_updater() { return &command_updater_; }
108 108
109 // Setters ///////////////////////////////////////////////////////////////// 109 // Setters /////////////////////////////////////////////////////////////////
110 110
111 void set_user_data_dir_profiles(const std::vector<std::wstring>& profiles) { 111 void set_user_data_dir_profiles(const std::vector<std::wstring>& profiles) {
112 g_browser_process->user_data_dir_profiles() = profiles; 112 g_browser_process->user_data_dir_profiles() = profiles;
113 } 113 }
114 114
115 void set_open_new_windows_in_default_browser(bool value) {
116 open_new_windows_in_default_browser_ = value;
117 }
118
115 // Browser Creation Helpers ///////////////////////////////////////////////// 119 // Browser Creation Helpers /////////////////////////////////////////////////
116 120
117 // Opens a new window with the default blank tab. 121 // Opens a new window with the default blank tab.
118 static void OpenEmptyWindow(Profile* profile); 122 static void OpenEmptyWindow(Profile* profile);
119 123
120 #if defined(OS_WIN) 124 #if defined(OS_WIN)
121 // Opens the a new application window for the specified WebApp. 125 // Opens the a new application window for the specified WebApp.
122 static void OpenWebApplication(Profile* profile, WebApp* app); 126 static void OpenWebApplication(Profile* profile, WebApp* app);
123 127
124 // Opens the specified URL in a new browser window in an incognito session. 128 // Opens the specified URL in a new browser window in an incognito session.
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 virtual void MoveContents(TabContents* source, const gfx::Rect& pos); 384 virtual void MoveContents(TabContents* source, const gfx::Rect& pos);
381 virtual bool IsPopup(TabContents* source); 385 virtual bool IsPopup(TabContents* source);
382 virtual void ToolbarSizeChanged(TabContents* source, bool is_animating); 386 virtual void ToolbarSizeChanged(TabContents* source, bool is_animating);
383 virtual void URLStarredChanged(TabContents* source, bool starred); 387 virtual void URLStarredChanged(TabContents* source, bool starred);
384 388
385 virtual void ContentsMouseEvent(TabContents* source, uint32 message); 389 virtual void ContentsMouseEvent(TabContents* source, uint32 message);
386 virtual void UpdateTargetURL(TabContents* source, const GURL& url); 390 virtual void UpdateTargetURL(TabContents* source, const GURL& url);
387 391
388 virtual void ContentsZoomChange(bool zoom_in); 392 virtual void ContentsZoomChange(bool zoom_in);
389 virtual bool IsApplication() const; 393 virtual bool IsApplication() const;
394 virtual bool ShouldOpenURLInDefaultBrowser() const;
390 virtual void ConvertContentsToApplication(TabContents* source); 395 virtual void ConvertContentsToApplication(TabContents* source);
391 virtual void ContentsStateChanged(TabContents* source); 396 virtual void ContentsStateChanged(TabContents* source);
392 virtual bool ShouldDisplayURLField(); 397 virtual bool ShouldDisplayURLField();
393 virtual void BeforeUnloadFired(TabContents* source, 398 virtual void BeforeUnloadFired(TabContents* source,
394 bool proceed, 399 bool proceed,
395 bool* proceed_to_fire_unload); 400 bool* proceed_to_fire_unload);
396 virtual void ShowHtmlDialog(HtmlDialogContentsDelegate* delegate, 401 virtual void ShowHtmlDialog(HtmlDialogContentsDelegate* delegate,
397 void* parent_window); 402 void* parent_window);
398 403
399 // Overridden from SelectFileDialog::Listener: 404 // Overridden from SelectFileDialog::Listener:
400 virtual void FileSelected(const std::wstring& path, void* params); 405 virtual void FileSelected(const std::wstring& path, void* params);
401 406
402 #endif // OS_WIN 407 #endif // OS_WIN
403 408
404 // Overridden from NotificationObserver: 409 // Overridden from NotificationObserver:
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 // Clears all the state associated with processing tabs' beforeunload/unload 496 // Clears all the state associated with processing tabs' beforeunload/unload
492 // events since the user cancelled closing the window. 497 // events since the user cancelled closing the window.
493 void CancelWindowClose(); 498 void CancelWindowClose();
494 499
495 // Removes |tab| from the passed |set|. 500 // Removes |tab| from the passed |set|.
496 // Returns whether the tab was in the set in the first place. 501 // Returns whether the tab was in the set in the first place.
497 // TODO(beng): this method needs a better name! 502 // TODO(beng): this method needs a better name!
498 bool RemoveFromSet(UnloadListenerSet* set, TabContents* tab); 503 bool RemoveFromSet(UnloadListenerSet* set, TabContents* tab);
499 504
500 // Cleans up state appropriately when we are trying to close the browser and 505 // Cleans up state appropriately when we are trying to close the browser and
501 // the tab has finished firing it's unload handler. We also use this in the 506 // the tab has finished firing it's unload handler. We also use this in the
502 // cases where a tab crashes or hangs even if the beforeunload/unload haven't 507 // cases where a tab crashes or hangs even if the beforeunload/unload haven't
503 // successfully fired. 508 // successfully fired.
504 void ClearUnloadState(TabContents* tab); 509 void ClearUnloadState(TabContents* tab);
505 510
506 // Assorted utility functions /////////////////////////////////////////////// 511 // Assorted utility functions ///////////////////////////////////////////////
507 512
508 // Retrieve the last active tabbed browser with the same profile as the 513 // Retrieve the last active tabbed browser with the same profile as the
509 // receiving Browser. Creates a new Browser if none are available. 514 // receiving Browser. Creates a new Browser if none are available.
510 Browser* GetOrCreateTabbedBrowser(); 515 Browser* GetOrCreateTabbedBrowser();
511 516
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 641
637 // Dialog box used for opening and saving files. 642 // Dialog box used for opening and saving files.
638 scoped_refptr<SelectFileDialog> select_file_dialog_; 643 scoped_refptr<SelectFileDialog> select_file_dialog_;
639 644
640 // The browser idle task helps cleanup unused memory resources when idle. 645 // The browser idle task helps cleanup unused memory resources when idle.
641 scoped_ptr<BrowserIdleTimer> idle_task_; 646 scoped_ptr<BrowserIdleTimer> idle_task_;
642 647
643 // Keep track of the encoding auto detect pref. 648 // Keep track of the encoding auto detect pref.
644 BooleanPrefMember encoding_auto_detect_; 649 BooleanPrefMember encoding_auto_detect_;
645 650
651 // Allows a client of a TabDelegate to decide how to launch a url.
652 bool open_new_windows_in_default_browser_;
653
646 DISALLOW_COPY_AND_ASSIGN(Browser); 654 DISALLOW_COPY_AND_ASSIGN(Browser);
647 }; 655 };
648 656
649 #endif // CHROME_BROWSER_BROWSER_H_ 657 #endif // CHROME_BROWSER_BROWSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698