diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-12 17:03:37 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-12 17:03:37 +0000 |
commit | 92e175a8152b4a7226cf8715aed8501ed7d83187 (patch) | |
tree | 67ca4faf8de98eef08cbc592f4b16b8d08d739be /chrome/browser/find_bar_controller.h | |
parent | 7985f9159ec6ba70fcdc4c76b6bc8787c074cb50 (diff) | |
download | chromium_src-92e175a8152b4a7226cf8715aed8501ed7d83187.zip chromium_src-92e175a8152b4a7226cf8715aed8501ed7d83187.tar.gz chromium_src-92e175a8152b4a7226cf8715aed8501ed7d83187.tar.bz2 |
Some work in refactoring FindBarWin/FindBarView so
we can share code across platforms.
See http://code.google.com/p/chromium/wiki/FindBarRefactoring for
more information about the design.
Review URL: http://codereview.chromium.org/42057
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11544 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/find_bar_controller.h')
-rw-r--r-- | chrome/browser/find_bar_controller.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/chrome/browser/find_bar_controller.h b/chrome/browser/find_bar_controller.h new file mode 100644 index 0000000..7551239 --- /dev/null +++ b/chrome/browser/find_bar_controller.h @@ -0,0 +1,51 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_FIND_BAR_CONTROLLER_H_ +#define CHROME_BROWSER_FIND_BAR_CONTROLLER_H_ + +#include "base/basictypes.h" +#include "base/scoped_ptr.h" +#include "chrome/common/notification_observer.h" + +class FindBar; +class WebContents; + +class FindBarController : public NotificationObserver { + public: + // FindBar takes ownership of |find_bar_view|. + FindBarController(FindBar* find_bar); + + virtual ~FindBarController(); + + // Shows the find bar. Any previous search string will again be visible. + void Show(); + + // Ends the current session. + void EndFindSession(); + + // Accessor for the attached WebContents. + WebContents* web_contents() const { return web_contents_; } + + // Changes the WebContents that this FindBar is attached to. This occurs when + // the user switches tabs in the Browser window. |contents| can be NULL. + void ChangeWebContents(WebContents* contents); + + // Overridden from NotificationObserver: + virtual void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); + + FindBar* get_find_bar() const { return find_bar_.get(); } + + private: + scoped_ptr<FindBar> find_bar_; + + // The WebContents we are currently associated with. Can be NULL. + WebContents* web_contents_; + + DISALLOW_COPY_AND_ASSIGN(FindBarController); +}; + +#endif // CHROME_BROWSER_FIND_BAR_CONTROLLER_H_ |