| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/chromeos/compact_location_bar.h" | 5 #include "chrome/browser/chromeos/compact_location_bar.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 | 9 |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| 11 #include "base/gfx/point.h" | 11 #include "base/gfx/point.h" |
| 12 #include "chrome/app/chrome_dll_resource.h" | 12 #include "chrome/app/chrome_dll_resource.h" |
| 13 #include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h" | 13 #include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h" |
| 14 #include "chrome/browser/browser_list.h" | 14 #include "chrome/browser/browser_list.h" |
| 15 #include "chrome/browser/browser_theme_provider.h" | 15 #include "chrome/browser/browser_theme_provider.h" |
| 16 #include "chrome/browser/profile.h" | 16 #include "chrome/browser/profile.h" |
| 17 #include "chrome/browser/view_ids.h" | 17 #include "chrome/browser/view_ids.h" |
| 18 #include "chrome/browser/views/event_utils.h" | 18 #include "chrome/browser/views/event_utils.h" |
| 19 #include "chrome/browser/views/frame/browser_view.h" | 19 #include "chrome/browser/views/frame/browser_view.h" |
| 20 #include "chrome/browser/views/tabs/tab.h" | 20 #include "chrome/browser/views/tabs/tab.h" |
| 21 #include "chrome/browser/views/tabs/tab_strip.h" | 21 #include "chrome/browser/views/tabs/tab_strip.h" |
| 22 #include "grit/chromium_strings.h" | 22 #include "grit/chromium_strings.h" |
| 23 #include "grit/generated_resources.h" | 23 #include "grit/generated_resources.h" |
| 24 #include "grit/theme_resources.h" | 24 #include "grit/theme_resources.h" |
| 25 #include "views/background.h" | 25 #include "views/background.h" |
| 26 #include "views/controls/button/image_button.h" | 26 #include "views/controls/button/image_button.h" |
| 27 #include "views/controls/native/native_view_host.h" | 27 #include "views/controls/native/native_view_host.h" |
| 28 #include "views/widget/widget.h" | 28 #include "views/widget/widget.h" |
| 29 | 29 |
| 30 namespace chromeos { |
| 31 |
| 30 const int kDefaultLocationBarWidth = 300; | 32 const int kDefaultLocationBarWidth = 300; |
| 31 const int kHideTimeoutInSeconds = 2; | 33 const int kHideTimeoutInSeconds = 2; |
| 32 | 34 |
| 33 CompactLocationBar::CompactLocationBar(BrowserView* browser_view) | 35 CompactLocationBar::CompactLocationBar(BrowserView* browser_view) |
| 34 : browser_view_(browser_view), | 36 : browser_view_(browser_view), |
| 35 current_contents_(NULL), | 37 current_contents_(NULL), |
| 36 reload_(NULL) { | 38 reload_(NULL) { |
| 37 popup_timer_.reset(new base::OneShotTimer<CompactLocationBar>()); | 39 popup_timer_.reset(new base::OneShotTimer<CompactLocationBar>()); |
| 38 set_background(views::Background::CreateStandardPanelBackground()); | 40 set_background(views::Background::CreateStandardPanelBackground()); |
| 39 } | 41 } |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 | 266 |
| 265 //////////////////////////////////////////////////////////////////////////////// | 267 //////////////////////////////////////////////////////////////////////////////// |
| 266 // BubblePositioner overrides: | 268 // BubblePositioner overrides: |
| 267 | 269 |
| 268 gfx::Rect CompactLocationBar::GetLocationStackBounds() const { | 270 gfx::Rect CompactLocationBar::GetLocationStackBounds() const { |
| 269 gfx::Point lower_left(0, height()); | 271 gfx::Point lower_left(0, height()); |
| 270 ConvertPointToScreen(this, &lower_left); | 272 ConvertPointToScreen(this, &lower_left); |
| 271 return gfx::Rect(lower_left.x(), lower_left.y(), 700, 100); | 273 return gfx::Rect(lower_left.x(), lower_left.y(), 700, 100); |
| 272 } | 274 } |
| 273 | 275 |
| 276 } // namespace chromeos |
| OLD | NEW |