| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/toolbar/toolbar_view.h" | 5 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/i18n/number_formatting.h" | 10 #include "base/i18n/number_formatting.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "chrome/grit/generated_resources.h" | 52 #include "chrome/grit/generated_resources.h" |
| 53 #include "chrome/grit/theme_resources.h" | 53 #include "chrome/grit/theme_resources.h" |
| 54 #include "components/omnibox/browser/omnibox_view.h" | 54 #include "components/omnibox/browser/omnibox_view.h" |
| 55 #include "components/prefs/pref_service.h" | 55 #include "components/prefs/pref_service.h" |
| 56 #include "components/strings/grit/components_strings.h" | 56 #include "components/strings/grit/components_strings.h" |
| 57 #include "content/public/browser/browser_accessibility_state.h" | 57 #include "content/public/browser/browser_accessibility_state.h" |
| 58 #include "content/public/browser/notification_service.h" | 58 #include "content/public/browser/notification_service.h" |
| 59 #include "content/public/browser/render_view_host.h" | 59 #include "content/public/browser/render_view_host.h" |
| 60 #include "content/public/browser/user_metrics.h" | 60 #include "content/public/browser/user_metrics.h" |
| 61 #include "content/public/browser/web_contents.h" | 61 #include "content/public/browser/web_contents.h" |
| 62 #include "ui/accessibility/ax_view_state.h" | 62 #include "ui/accessibility/ax_node_data.h" |
| 63 #include "ui/base/l10n/l10n_util.h" | 63 #include "ui/base/l10n/l10n_util.h" |
| 64 #include "ui/base/material_design/material_design_controller.h" | 64 #include "ui/base/material_design/material_design_controller.h" |
| 65 #include "ui/base/theme_provider.h" | 65 #include "ui/base/theme_provider.h" |
| 66 #include "ui/base/window_open_disposition.h" | 66 #include "ui/base/window_open_disposition.h" |
| 67 #include "ui/compositor/layer.h" | 67 #include "ui/compositor/layer.h" |
| 68 #include "ui/gfx/canvas.h" | 68 #include "ui/gfx/canvas.h" |
| 69 #include "ui/gfx/image/canvas_image_source.h" | 69 #include "ui/gfx/image/canvas_image_source.h" |
| 70 #include "ui/gfx/paint_vector_icon.h" | 70 #include "ui/gfx/paint_vector_icon.h" |
| 71 #include "ui/gfx/vector_icons_public.h" | 71 #include "ui/gfx/vector_icons_public.h" |
| 72 #include "ui/keyboard/keyboard_controller.h" | 72 #include "ui/keyboard/keyboard_controller.h" |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 // ToolbarView, AccessiblePaneView overrides: | 367 // ToolbarView, AccessiblePaneView overrides: |
| 368 | 368 |
| 369 bool ToolbarView::SetPaneFocus(views::View* initial_focus) { | 369 bool ToolbarView::SetPaneFocus(views::View* initial_focus) { |
| 370 if (!AccessiblePaneView::SetPaneFocus(initial_focus)) | 370 if (!AccessiblePaneView::SetPaneFocus(initial_focus)) |
| 371 return false; | 371 return false; |
| 372 | 372 |
| 373 location_bar_->SetShowFocusRect(true); | 373 location_bar_->SetShowFocusRect(true); |
| 374 return true; | 374 return true; |
| 375 } | 375 } |
| 376 | 376 |
| 377 void ToolbarView::GetAccessibleState(ui::AXViewState* state) { | 377 void ToolbarView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 378 state->role = ui::AX_ROLE_TOOLBAR; | 378 node_data->role = ui::AX_ROLE_TOOLBAR; |
| 379 state->name = l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLBAR); | 379 node_data->SetName(l10n_util::GetStringUTF8(IDS_ACCNAME_TOOLBAR)); |
| 380 } | 380 } |
| 381 | 381 |
| 382 //////////////////////////////////////////////////////////////////////////////// | 382 //////////////////////////////////////////////////////////////////////////////// |
| 383 // ToolbarView, Menu::Delegate overrides: | 383 // ToolbarView, Menu::Delegate overrides: |
| 384 | 384 |
| 385 bool ToolbarView::GetAcceleratorInfo(int id, ui::Accelerator* accel) { | 385 bool ToolbarView::GetAcceleratorInfo(int id, ui::Accelerator* accel) { |
| 386 return GetWidget()->GetAccelerator(id, accel); | 386 return GetWidget()->GetAccelerator(id, accel); |
| 387 } | 387 } |
| 388 | 388 |
| 389 //////////////////////////////////////////////////////////////////////////////// | 389 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 if (OutdatedUpgradeBubbleView::IsAvailable()) { | 778 if (OutdatedUpgradeBubbleView::IsAvailable()) { |
| 779 OutdatedUpgradeBubbleView::ShowBubble(app_menu_button_, browser_, | 779 OutdatedUpgradeBubbleView::ShowBubble(app_menu_button_, browser_, |
| 780 auto_update_enabled); | 780 auto_update_enabled); |
| 781 } | 781 } |
| 782 } | 782 } |
| 783 | 783 |
| 784 void ToolbarView::OnShowHomeButtonChanged() { | 784 void ToolbarView::OnShowHomeButtonChanged() { |
| 785 Layout(); | 785 Layout(); |
| 786 SchedulePaint(); | 786 SchedulePaint(); |
| 787 } | 787 } |
| OLD | NEW |