| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_FIND_BAR_FIND_BAR_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_CONTROLLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 void EndFindSession(SelectionAction action); | 39 void EndFindSession(SelectionAction action); |
| 40 | 40 |
| 41 // Accessor for the attached TabContentsWrapper. | 41 // Accessor for the attached TabContentsWrapper. |
| 42 TabContentsWrapper* tab_contents() const { return tab_contents_; } | 42 TabContentsWrapper* tab_contents() const { return tab_contents_; } |
| 43 | 43 |
| 44 // Changes the TabContents that this FindBar is attached to. This occurs when | 44 // Changes the TabContents that this FindBar is attached to. This occurs when |
| 45 // the user switches tabs in the Browser window. |contents| can be NULL. | 45 // the user switches tabs in the Browser window. |contents| can be NULL. |
| 46 void ChangeTabContents(TabContentsWrapper* contents); | 46 void ChangeTabContents(TabContentsWrapper* contents); |
| 47 | 47 |
| 48 // Overridden from NotificationObserver: | 48 // Overridden from NotificationObserver: |
| 49 virtual void Observe(NotificationType type, | 49 virtual void Observe(int type, |
| 50 const NotificationSource& source, | 50 const NotificationSource& source, |
| 51 const NotificationDetails& details); | 51 const NotificationDetails& details); |
| 52 | 52 |
| 53 FindBar* find_bar() const { return find_bar_.get(); } | 53 FindBar* find_bar() const { return find_bar_.get(); } |
| 54 | 54 |
| 55 // Reposition |view_location| such that it avoids |avoid_overlapping_rect|, | 55 // Reposition |view_location| such that it avoids |avoid_overlapping_rect|, |
| 56 // and return the new location. | 56 // and return the new location. |
| 57 static gfx::Rect GetLocationForFindbarView( | 57 static gfx::Rect GetLocationForFindbarView( |
| 58 gfx::Rect view_location, | 58 gfx::Rect view_location, |
| 59 const gfx::Rect& dialog_bounds, | 59 const gfx::Rect& dialog_bounds, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 80 TabContentsWrapper* tab_contents_; | 80 TabContentsWrapper* tab_contents_; |
| 81 | 81 |
| 82 // The last match count we reported to the user. This is used by | 82 // The last match count we reported to the user. This is used by |
| 83 // UpdateFindBarForCurrentResult to avoid flickering. | 83 // UpdateFindBarForCurrentResult to avoid flickering. |
| 84 int last_reported_matchcount_; | 84 int last_reported_matchcount_; |
| 85 | 85 |
| 86 DISALLOW_COPY_AND_ASSIGN(FindBarController); | 86 DISALLOW_COPY_AND_ASSIGN(FindBarController); |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 #endif // CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_CONTROLLER_H_ | 89 #endif // CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_CONTROLLER_H_ |
| OLD | NEW |