OLD | NEW |
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_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 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 content::WebContents* web_contents() const { return web_contents_; } | 56 content::WebContents* web_contents() const { return web_contents_; } |
57 | 57 |
58 // Changes the WebContents that this FindBar is attached to. This | 58 // Changes the WebContents that this FindBar is attached to. This |
59 // occurs when the user switches tabs in the Browser window. |contents| can be | 59 // occurs when the user switches tabs in the Browser window. |contents| can be |
60 // NULL. | 60 // NULL. |
61 void ChangeWebContents(content::WebContents* contents); | 61 void ChangeWebContents(content::WebContents* contents); |
62 | 62 |
63 // Overridden from content::NotificationObserver: | 63 // Overridden from content::NotificationObserver: |
64 virtual void Observe(int type, | 64 virtual void Observe(int type, |
65 const content::NotificationSource& source, | 65 const content::NotificationSource& source, |
66 const content::NotificationDetails& details) OVERRIDE; | 66 const content::NotificationDetails& details) override; |
67 | 67 |
68 FindBar* find_bar() const { return find_bar_.get(); } | 68 FindBar* find_bar() const { return find_bar_.get(); } |
69 | 69 |
70 // Reposition |view_location| such that it avoids |avoid_overlapping_rect|, | 70 // Reposition |view_location| such that it avoids |avoid_overlapping_rect|, |
71 // and return the new location. | 71 // and return the new location. |
72 static gfx::Rect GetLocationForFindbarView( | 72 static gfx::Rect GetLocationForFindbarView( |
73 gfx::Rect view_location, | 73 gfx::Rect view_location, |
74 const gfx::Rect& dialog_bounds, | 74 const gfx::Rect& dialog_bounds, |
75 const gfx::Rect& avoid_overlapping_rect); | 75 const gfx::Rect& avoid_overlapping_rect); |
76 | 76 |
(...skipping 18 matching lines...) Expand all Loading... |
95 content::WebContents* web_contents_; | 95 content::WebContents* web_contents_; |
96 | 96 |
97 // The last match count we reported to the user. This is used by | 97 // The last match count we reported to the user. This is used by |
98 // UpdateFindBarForCurrentResult to avoid flickering. | 98 // UpdateFindBarForCurrentResult to avoid flickering. |
99 int last_reported_matchcount_; | 99 int last_reported_matchcount_; |
100 | 100 |
101 DISALLOW_COPY_AND_ASSIGN(FindBarController); | 101 DISALLOW_COPY_AND_ASSIGN(FindBarController); |
102 }; | 102 }; |
103 | 103 |
104 #endif // CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_CONTROLLER_H_ | 104 #endif // CHROME_BROWSER_UI_FIND_BAR_FIND_BAR_CONTROLLER_H_ |
OLD | NEW |