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 #include "chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.h" | 5 #include "chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.h" |
6 | 6 |
7 #if defined(TOOLKIT_USES_GTK) | 7 #if defined(TOOLKIT_USES_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "ui/base/animation/slide_animation.h" | 27 #include "ui/base/animation/slide_animation.h" |
28 #include "ui/base/keycodes/keyboard_codes.h" | 28 #include "ui/base/keycodes/keyboard_codes.h" |
29 #include "ui/gfx/rect.h" | 29 #include "ui/gfx/rect.h" |
30 #include "views/controls/scrollbar/native_scroll_bar.h" | 30 #include "views/controls/scrollbar/native_scroll_bar.h" |
31 #include "views/events/event.h" | 31 #include "views/events/event.h" |
32 #include "views/focus/external_focus_tracker.h" | 32 #include "views/focus/external_focus_tracker.h" |
33 #include "views/focus/view_storage.h" | 33 #include "views/focus/view_storage.h" |
34 #include "views/widget/root_view.h" | 34 #include "views/widget/root_view.h" |
35 #include "views/widget/widget.h" | 35 #include "views/widget/widget.h" |
36 | 36 |
| 37 #if defined(OS_WIN) |
| 38 #include "ui/base/win/event_util.h" |
| 39 #endif |
| 40 |
37 namespace { | 41 namespace { |
38 | 42 |
39 const int kHideTimeoutInSeconds = 2; | 43 const int kHideTimeoutInSeconds = 2; |
40 // TODO(stevet): Share this with CompactLocationBarView. This is the actual | 44 // TODO(stevet): Share this with CompactLocationBarView. This is the actual |
41 // height, without the overlap added. | 45 // height, without the overlap added. |
42 const int kCompactNavbarSpacerHeight = 4; | 46 const int kCompactNavbarSpacerHeight = 4; |
43 const int kBookmarkBarLocationBarOverlap = 2; | 47 const int kBookmarkBarLocationBarOverlap = 2; |
44 const int kSpacerLocationbarOverlap = 1; | 48 const int kSpacerLocationbarOverlap = 1; |
45 | 49 |
46 } // namespace | 50 } // namespace |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 #if !defined(USE_AURA) | 144 #if !defined(USE_AURA) |
141 if (observing_) { | 145 if (observing_) { |
142 loop->RemoveObserver(this); | 146 loop->RemoveObserver(this); |
143 observing_ = false; | 147 observing_ = false; |
144 } | 148 } |
145 #endif | 149 #endif |
146 } | 150 } |
147 | 151 |
148 bool MouseObserver::IsMouseEvent(const views::NativeEvent& native_event) { | 152 bool MouseObserver::IsMouseEvent(const views::NativeEvent& native_event) { |
149 #if defined(OS_WIN) || defined(USE_AURA) | 153 #if defined(OS_WIN) || defined(USE_AURA) |
150 return views::IsClientMouseEvent(native_event) || | 154 return ui::IsMouseEvent(native_event); |
151 views::IsNonClientMouseEvent(native_event); | |
152 #elif defined(OS_LINUX) | 155 #elif defined(OS_LINUX) |
153 return native_event->type == GDK_MOTION_NOTIFY || | 156 return native_event->type == GDK_MOTION_NOTIFY || |
154 native_event->type == GDK_BUTTON_PRESS || | 157 native_event->type == GDK_BUTTON_PRESS || |
155 native_event->type == GDK_2BUTTON_PRESS || | 158 native_event->type == GDK_2BUTTON_PRESS || |
156 native_event->type == GDK_3BUTTON_PRESS || | 159 native_event->type == GDK_3BUTTON_PRESS || |
157 native_event->type == GDK_BUTTON_RELEASE; | 160 native_event->type == GDK_BUTTON_RELEASE; |
158 #endif | 161 #endif |
159 } | 162 } |
160 | 163 |
161 // TODO(mad): Would be nice to have a NativeEvent -> NativeWindow mapping. | 164 // TODO(mad): Would be nice to have a NativeEvent -> NativeWindow mapping. |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 bool CompactLocationBarViewHost::IsCurrentTabIndex(int index) { | 547 bool CompactLocationBarViewHost::IsCurrentTabIndex(int index) { |
545 return current_tab_model_index_ == index; | 548 return current_tab_model_index_ == index; |
546 } | 549 } |
547 | 550 |
548 bool CompactLocationBarViewHost::IsCurrentTab(TabContents* contents) { | 551 bool CompactLocationBarViewHost::IsCurrentTab(TabContents* contents) { |
549 TabStripModel* tab_strip_model = browser_view()->browser()->tabstrip_model(); | 552 TabStripModel* tab_strip_model = browser_view()->browser()->tabstrip_model(); |
550 return tab_strip_model->ContainsIndex(current_tab_model_index_) && | 553 return tab_strip_model->ContainsIndex(current_tab_model_index_) && |
551 tab_strip_model->GetTabContentsAt(current_tab_model_index_)-> | 554 tab_strip_model->GetTabContentsAt(current_tab_model_index_)-> |
552 tab_contents() == contents; | 555 tab_contents() == contents; |
553 } | 556 } |
OLD | NEW |