1 // Copyright 2013 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CHROME_BROWSER_UI_SCOPED_TABBED_BROWSER_DISPLAYER_H_ 6 #define CHROME_BROWSER_UI_SCOPED_TABBED_BROWSER_DISPLAYER_H_ 7 8 #include "base/basictypes.h" 9 #include "chrome/browser/ui/host_desktop.h" 10 11 class Browser; 12 class Profile; 13 14 namespace chrome { 15 16 // This class finds the last active tabbed browser matching |profile| and 17 // |type|. If there is no tabbed browser, a new non visible browser is created. 18 // ScopedTabbedBrowserDisplayer ensures that the browser is made visible and is 19 // activated by the time that ScopedTabbedBrowserDisplayer goes out of scope. 20 class ScopedTabbedBrowserDisplayer { 21 public: 22 ScopedTabbedBrowserDisplayer(Profile* profile, HostDesktopType type); 23 ~ScopedTabbedBrowserDisplayer(); 24 25 Browser* browser() { 26 return browser_; 27 } 28 29 private: 30 Browser* browser_; 31 32 DISALLOW_COPY_AND_ASSIGN(ScopedTabbedBrowserDisplayer); 33 }; 34 35 } // namespace chrome 36 37 #endif // CHROME_BROWSER_UI_SCOPED_TABBED_BROWSER_DISPLAYER_H_ 38