| OLD | NEW |
| 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 #include "chrome/browser/views/location_bar/location_bar_view.h" | 5 #include "chrome/browser/views/location_bar/location_bar_view.h" |
| 6 | 6 |
| 7 #if defined(OS_LINUX) | 7 #if defined(OS_LINUX) |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| 11 #include "app/drag_drop_types.h" | 11 #include "app/drag_drop_types.h" |
| 12 #include "app/l10n_util.h" | 12 #include "app/l10n_util.h" |
| 13 #include "app/resource_bundle.h" | 13 #include "app/resource_bundle.h" |
| 14 #include "app/theme_provider.h" | 14 #include "app/theme_provider.h" |
| 15 #include "chrome/app/chrome_dll_resource.h" | 15 #include "chrome/app/chrome_dll_resource.h" |
| 16 #include "chrome/browser/alternate_nav_url_fetcher.h" | 16 #include "chrome/browser/alternate_nav_url_fetcher.h" |
| 17 #include "chrome/browser/extensions/extension_browser_event_router.h" | 17 #include "chrome/browser/extensions/extension_browser_event_router.h" |
| 18 #include "chrome/browser/extensions/extensions_service.h" | 18 #include "chrome/browser/extensions/extensions_service.h" |
| 19 #include "chrome/browser/profile.h" | 19 #include "chrome/browser/profile.h" |
| 20 #include "chrome/browser/view_ids.h" | 20 #include "chrome/browser/view_ids.h" |
| 21 #include "chrome/browser/views/browser_dialogs.h" | 21 #include "chrome/browser/views/browser_dialogs.h" |
| 22 #include "chrome/browser/views/location_bar/content_setting_image_view.h" | 22 #include "chrome/browser/views/location_bar/content_setting_image_view.h" |
| 23 #include "chrome/browser/views/location_bar/ev_bubble_view.h" | 23 #include "chrome/browser/views/location_bar/ev_bubble_view.h" |
| 24 #include "chrome/browser/views/location_bar/keyword_hint_view.h" | 24 #include "chrome/browser/views/location_bar/keyword_hint_view.h" |
| 25 #include "chrome/browser/views/location_bar/location_icon_view.h" | 25 #include "chrome/browser/views/location_bar/location_icon_view.h" |
| 26 #include "chrome/browser/views/location_bar/page_action_image_view.h" | 26 #include "chrome/browser/views/location_bar/page_action_image_view.h" |
| 27 #include "chrome/browser/views/location_bar/page_action_with_badge_view.h" | 27 #include "chrome/browser/views/location_bar/page_action_with_badge_view.h" |
| 28 #include "chrome/browser/views/location_bar/selected_keyword_view.h" | 28 #include "chrome/browser/views/location_bar/selected_keyword_view.h" |
| 29 #include "chrome/browser/views/location_bar/star_view.h" | 29 #include "chrome/browser/views/location_bar/star_view.h" |
| 30 #include "gfx/canvas_skia.h" | 30 #include "gfx/canvas.h" |
| 31 #include "gfx/color_utils.h" | 31 #include "gfx/color_utils.h" |
| 32 #include "gfx/skia_util.h" | 32 #include "gfx/skia_util.h" |
| 33 #include "grit/generated_resources.h" | 33 #include "grit/generated_resources.h" |
| 34 #include "grit/theme_resources.h" | 34 #include "grit/theme_resources.h" |
| 35 #include "views/drag_utils.h" | 35 #include "views/drag_utils.h" |
| 36 | 36 |
| 37 #if defined(OS_WIN) | 37 #if defined(OS_WIN) |
| 38 #include "chrome/browser/views/first_run_bubble.h" | 38 #include "chrome/browser/views/first_run_bubble.h" |
| 39 #endif | 39 #endif |
| 40 | 40 |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 SkColor color(GetColor(ToolbarModel::NONE, BACKGROUND)); | 549 SkColor color(GetColor(ToolbarModel::NONE, BACKGROUND)); |
| 550 if (mode_ == NORMAL) { | 550 if (mode_ == NORMAL) { |
| 551 SkPaint paint; | 551 SkPaint paint; |
| 552 paint.setColor(color); | 552 paint.setColor(color); |
| 553 paint.setStyle(SkPaint::kFill_Style); | 553 paint.setStyle(SkPaint::kFill_Style); |
| 554 paint.setAntiAlias(true); | 554 paint.setAntiAlias(true); |
| 555 // The round corners of the omnibox match the round corners of the dropdown | 555 // The round corners of the omnibox match the round corners of the dropdown |
| 556 // below, and all our other bubbles. | 556 // below, and all our other bubbles. |
| 557 const SkScalar radius(SkIntToScalar(BubbleBorder::GetCornerRadius())); | 557 const SkScalar radius(SkIntToScalar(BubbleBorder::GetCornerRadius())); |
| 558 bounds.Inset(kEdgeThickness, 0); | 558 bounds.Inset(kEdgeThickness, 0); |
| 559 canvas->AsCanvasSkia()->drawRoundRect(gfx::RectToSkRect(bounds), radius, | 559 canvas->drawRoundRect(gfx::RectToSkRect(bounds), radius, radius, paint); |
| 560 radius, paint); | |
| 561 } else { | 560 } else { |
| 562 canvas->FillRectInt(color, bounds.x(), bounds.y(), bounds.width(), | 561 canvas->FillRectInt(color, bounds.x(), bounds.y(), bounds.width(), |
| 563 bounds.height()); | 562 bounds.height()); |
| 564 } | 563 } |
| 565 | 564 |
| 566 if (show_focus_rect_ && HasFocus()) { | 565 if (show_focus_rect_ && HasFocus()) { |
| 567 gfx::Rect r = location_entry_view_->bounds(); | 566 gfx::Rect r = location_entry_view_->bounds(); |
| 568 #if defined(OS_WIN) | 567 #if defined(OS_WIN) |
| 569 canvas->DrawFocusRect(r.x() - 1, r.y() - 1, r.width() + 2, r.height() + 2); | 568 canvas->DrawFocusRect(r.x() - 1, r.y() - 1, r.width() + 2, r.height() + 2); |
| 570 #else | 569 #else |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1030 page_action_views_[i]->image_view()->ExecuteAction(kLeftMouseButton, | 1029 page_action_views_[i]->image_view()->ExecuteAction(kLeftMouseButton, |
| 1031 false); // inspect_with_devtools | 1030 false); // inspect_with_devtools |
| 1032 return; | 1031 return; |
| 1033 } | 1032 } |
| 1034 ++current; | 1033 ++current; |
| 1035 } | 1034 } |
| 1036 } | 1035 } |
| 1037 | 1036 |
| 1038 NOTREACHED(); | 1037 NOTREACHED(); |
| 1039 } | 1038 } |
| OLD | NEW |