| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tabs/tab_strip.h" | 5 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <iterator> | 10 #include <iterator> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "chrome/browser/ui/views/touch_uma/touch_uma.h" | 33 #include "chrome/browser/ui/views/touch_uma/touch_uma.h" |
| 34 #include "chrome/common/chrome_switches.h" | 34 #include "chrome/common/chrome_switches.h" |
| 35 #include "chrome/grit/generated_resources.h" | 35 #include "chrome/grit/generated_resources.h" |
| 36 #include "chrome/grit/theme_resources.h" | 36 #include "chrome/grit/theme_resources.h" |
| 37 #include "content/public/browser/user_metrics.h" | 37 #include "content/public/browser/user_metrics.h" |
| 38 #include "content/public/common/content_switches.h" | 38 #include "content/public/common/content_switches.h" |
| 39 #include "third_party/skia/include/core/SkColorFilter.h" | 39 #include "third_party/skia/include/core/SkColorFilter.h" |
| 40 #include "third_party/skia/include/effects/SkBlurMaskFilter.h" | 40 #include "third_party/skia/include/effects/SkBlurMaskFilter.h" |
| 41 #include "third_party/skia/include/effects/SkLayerDrawLooper.h" | 41 #include "third_party/skia/include/effects/SkLayerDrawLooper.h" |
| 42 #include "third_party/skia/include/pathops/SkPathOps.h" | 42 #include "third_party/skia/include/pathops/SkPathOps.h" |
| 43 #include "ui/accessibility/ax_view_state.h" | 43 #include "ui/accessibility/ax_node_data.h" |
| 44 #include "ui/base/default_theme_provider.h" | 44 #include "ui/base/default_theme_provider.h" |
| 45 #include "ui/base/dragdrop/drag_drop_types.h" | 45 #include "ui/base/dragdrop/drag_drop_types.h" |
| 46 #include "ui/base/l10n/l10n_util.h" | 46 #include "ui/base/l10n/l10n_util.h" |
| 47 #include "ui/base/models/list_selection_model.h" | 47 #include "ui/base/models/list_selection_model.h" |
| 48 #include "ui/base/resource/resource_bundle.h" | 48 #include "ui/base/resource/resource_bundle.h" |
| 49 #include "ui/compositor/compositing_recorder.h" | 49 #include "ui/compositor/compositing_recorder.h" |
| 50 #include "ui/compositor/paint_recorder.h" | 50 #include "ui/compositor/paint_recorder.h" |
| 51 #include "ui/display/display.h" | 51 #include "ui/display/display.h" |
| 52 #include "ui/display/screen.h" | 52 #include "ui/display/screen.h" |
| 53 #include "ui/gfx/animation/animation_container.h" | 53 #include "ui/gfx/animation/animation_container.h" |
| (...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1343 const bool incognito = controller_->IsIncognito(); | 1343 const bool incognito = controller_->IsIncognito(); |
| 1344 const int id = incognito ? | 1344 const int id = incognito ? |
| 1345 IDR_THEME_TAB_BACKGROUND_INCOGNITO : IDR_THEME_TAB_BACKGROUND; | 1345 IDR_THEME_TAB_BACKGROUND_INCOGNITO : IDR_THEME_TAB_BACKGROUND; |
| 1346 *custom_image = | 1346 *custom_image = |
| 1347 tp->HasCustomImage(id) || tp->HasCustomImage(IDR_THEME_FRAME) || | 1347 tp->HasCustomImage(id) || tp->HasCustomImage(IDR_THEME_FRAME) || |
| 1348 (incognito && tp->HasCustomImage(IDR_THEME_FRAME_INCOGNITO)); | 1348 (incognito && tp->HasCustomImage(IDR_THEME_FRAME_INCOGNITO)); |
| 1349 return id; | 1349 return id; |
| 1350 } | 1350 } |
| 1351 | 1351 |
| 1352 void TabStrip::UpdateTabAccessibilityState(const Tab* tab, | 1352 void TabStrip::UpdateTabAccessibilityState(const Tab* tab, |
| 1353 ui::AXViewState* state) { | 1353 ui::AXNodeData* node_data) { |
| 1354 state->count = tab_count(); | 1354 node_data->AddIntAttribute(ui::AX_ATTR_SET_SIZE, tab_count()); |
| 1355 state->index = GetModelIndexOfTab(tab); | 1355 node_data->AddIntAttribute(ui::AX_ATTR_POS_IN_SET, GetModelIndexOfTab(tab)); |
| 1356 } | 1356 } |
| 1357 | 1357 |
| 1358 void TabStrip::MouseMovedOutOfHost() { | 1358 void TabStrip::MouseMovedOutOfHost() { |
| 1359 ResizeLayoutTabs(); | 1359 ResizeLayoutTabs(); |
| 1360 if (reset_to_shrink_on_exit_) { | 1360 if (reset_to_shrink_on_exit_) { |
| 1361 reset_to_shrink_on_exit_ = false; | 1361 reset_to_shrink_on_exit_ = false; |
| 1362 SetStackedLayout(false); | 1362 SetStackedLayout(false); |
| 1363 controller_->StackedLayoutMaybeChanged(); | 1363 controller_->StackedLayoutMaybeChanged(); |
| 1364 } | 1364 } |
| 1365 } | 1365 } |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1571 ui::OSExchangeData::CONVERT_FILENAMES, &url, &title) || | 1571 ui::OSExchangeData::CONVERT_FILENAMES, &url, &title) || |
| 1572 !url.is_valid() || | 1572 !url.is_valid() || |
| 1573 url.SchemeIs(url::kJavaScriptScheme)) | 1573 url.SchemeIs(url::kJavaScriptScheme)) |
| 1574 return ui::DragDropTypes::DRAG_NONE; | 1574 return ui::DragDropTypes::DRAG_NONE; |
| 1575 | 1575 |
| 1576 controller_->PerformDrop(drop_before, drop_index, url); | 1576 controller_->PerformDrop(drop_before, drop_index, url); |
| 1577 | 1577 |
| 1578 return GetDropEffect(event); | 1578 return GetDropEffect(event); |
| 1579 } | 1579 } |
| 1580 | 1580 |
| 1581 void TabStrip::GetAccessibleState(ui::AXViewState* state) { | 1581 void TabStrip::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 1582 state->role = ui::AX_ROLE_TAB_LIST; | 1582 node_data->role = ui::AX_ROLE_TAB_LIST; |
| 1583 } | 1583 } |
| 1584 | 1584 |
| 1585 views::View* TabStrip::GetTooltipHandlerForPoint(const gfx::Point& point) { | 1585 views::View* TabStrip::GetTooltipHandlerForPoint(const gfx::Point& point) { |
| 1586 if (!HitTestPoint(point)) | 1586 if (!HitTestPoint(point)) |
| 1587 return NULL; | 1587 return NULL; |
| 1588 | 1588 |
| 1589 if (!touch_layout_) { | 1589 if (!touch_layout_) { |
| 1590 // Return any view that isn't a Tab or this TabStrip immediately. We don't | 1590 // Return any view that isn't a Tab or this TabStrip immediately. We don't |
| 1591 // want to interfere. | 1591 // want to interfere. |
| 1592 views::View* v = View::GetTooltipHandlerForPoint(point); | 1592 views::View* v = View::GetTooltipHandlerForPoint(point); |
| (...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2804 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); | 2804 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); |
| 2805 if (view) | 2805 if (view) |
| 2806 return view; | 2806 return view; |
| 2807 } | 2807 } |
| 2808 Tab* tab = FindTabForEvent(point); | 2808 Tab* tab = FindTabForEvent(point); |
| 2809 if (tab) | 2809 if (tab) |
| 2810 return ConvertPointToViewAndGetEventHandler(this, tab, point); | 2810 return ConvertPointToViewAndGetEventHandler(this, tab, point); |
| 2811 } | 2811 } |
| 2812 return this; | 2812 return this; |
| 2813 } | 2813 } |
| OLD | NEW |