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

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

Issue 2124003: More TabStrip refactoring. (Closed)
Patch Set: Merge with trunk Created 10 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/compact_location_bar_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_CHROMEOS_COMPACT_LOCATION_BAR_HOST_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_COMPACT_LOCATION_BAR_HOST_H_
6 #define CHROME_BROWSER_CHROMEOS_COMPACT_LOCATION_BAR_HOST_H_ 6 #define CHROME_BROWSER_CHROMEOS_COMPACT_LOCATION_BAR_HOST_H_
7 7
8 #include "app/animation.h" 8 #include "app/animation.h"
9 #include "base/timer.h" 9 #include "base/timer.h"
10 #include "chrome/browser/tabs/tab_strip_model.h" 10 #include "chrome/browser/tabs/tab_strip_model.h"
(...skipping 25 matching lines...) Expand all
36 // when the compact navigation bar is toggled. 36 // when the compact navigation bar is toggled.
37 // 37 //
38 //////////////////////////////////////////////////////////////////////////////// 38 ////////////////////////////////////////////////////////////////////////////////
39 class CompactLocationBarHost : public DropdownBarHost, 39 class CompactLocationBarHost : public DropdownBarHost,
40 public TabStripModelObserver { 40 public TabStripModelObserver {
41 public: 41 public:
42 explicit CompactLocationBarHost(::BrowserView* browser_view); 42 explicit CompactLocationBarHost(::BrowserView* browser_view);
43 virtual ~CompactLocationBarHost(); 43 virtual ~CompactLocationBarHost();
44 44
45 // Returns the bounds to locale the compact location bar under the tab. 45 // Returns the bounds to locale the compact location bar under the tab.
46 gfx::Rect GetBoundsUnderTab(int tab_index) const; 46 gfx::Rect GetBoundsUnderTab(int model_index) const;
47 47
48 // Updates the content and the position of the compact location bar. 48 // Updates the content and the position of the compact location bar.
49 // |index| is the index of the tab the compact location bar 49 // |model_index| is the index of the tab the compact location bar
50 // will be attached to and |animate| specifies if the location bar 50 // will be attached to and |animate| specifies if the location bar
51 // should animate when shown. 51 // should animate when shown.
52 void Update(int index, bool animate, bool select_all); 52 void Update(int model_index, bool animate, bool select_all);
53 53
54 // (Re)Starts the popup timer that hides the popup after X seconds. 54 // (Re)Starts the popup timer that hides the popup after X seconds.
55 void StartAutoHideTimer(); 55 void StartAutoHideTimer();
56 56
57 // Cancels the popup timer. 57 // Cancels the popup timer.
58 void CancelAutoHideTimer(); 58 void CancelAutoHideTimer();
59 59
60 // Enable/disable the compact location bar. 60 // Enable/disable the compact location bar.
61 void SetEnabled(bool enabled); 61 void SetEnabled(bool enabled);
62 62
(...skipping 29 matching lines...) Expand all
92 92
93 void HideCallback() { 93 void HideCallback() {
94 Hide(true); 94 Hide(true);
95 } 95 }
96 96
97 // Returns CompactLocationBarView. 97 // Returns CompactLocationBarView.
98 CompactLocationBarView* GetClbView(); 98 CompactLocationBarView* GetClbView();
99 99
100 bool IsCurrentTabIndex(int index); 100 bool IsCurrentTabIndex(int index);
101 101
102 // The index of the tab that the compact location bar is attached to. 102 // The index of the tab, in terms of the model, that the compact location bar
103 int current_tab_index_; 103 // is attached to.
104 int current_tab_model_index_;
104 105
105 scoped_ptr<base::OneShotTimer<CompactLocationBarHost> > auto_hide_timer_; 106 scoped_ptr<base::OneShotTimer<CompactLocationBarHost> > auto_hide_timer_;
106 107
107 scoped_ptr<MouseObserver> mouse_observer_; 108 scoped_ptr<MouseObserver> mouse_observer_;
108 109
109 DISALLOW_COPY_AND_ASSIGN(CompactLocationBarHost); 110 DISALLOW_COPY_AND_ASSIGN(CompactLocationBarHost);
110 }; 111 };
111 112
112 } // namespace chromeos 113 } // namespace chromeos
113 114
114 #endif // CHROME_BROWSER_CHROMEOS_COMPACT_LOCATION_BAR_HOST_H_ 115 #endif // CHROME_BROWSER_CHROMEOS_COMPACT_LOCATION_BAR_HOST_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/compact_location_bar_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698