Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/website_settings/chooser_bubble_ui_view.h" | 5 #include "chrome/browser/ui/views/website_settings/chooser_bubble_ui_view.h" |
| 6 | 6 |
| 7 #include <stddef.h> | |
| 8 | |
| 7 #include <algorithm> | 9 #include <algorithm> |
| 8 #include <string> | 10 #include <string> |
| 11 #include <vector> | |
| 9 | 12 |
| 10 #include "base/macros.h" | 13 #include "base/macros.h" |
| 11 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
| 14 #include "chrome/browser/ui/views/exclusive_access_bubble_views.h" | 17 #include "chrome/browser/ui/views/exclusive_access_bubble_views.h" |
| 15 #include "chrome/browser/ui/views/frame/browser_view.h" | 18 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 16 #include "chrome/browser/ui/views/frame/top_container_view.h" | 19 #include "chrome/browser/ui/views/frame/top_container_view.h" |
| 17 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 20 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 18 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" | 21 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" |
| 19 #include "chrome/browser/ui/website_settings/chooser_bubble_delegate.h" | 22 #include "chrome/browser/ui/website_settings/chooser_bubble_delegate.h" |
| 20 #include "chrome/common/pref_names.h" | 23 #include "chrome/common/pref_names.h" |
| 21 #include "chrome/grit/generated_resources.h" | 24 #include "chrome/grit/generated_resources.h" |
| 22 #include "components/prefs/pref_service.h" | 25 #include "components/prefs/pref_service.h" |
| 23 #include "ui/accessibility/ax_view_state.h" | 26 #include "ui/accessibility/ax_view_state.h" |
| 24 #include "ui/base/l10n/l10n_util.h" | 27 #include "ui/base/l10n/l10n_util.h" |
| 25 #include "ui/base/resource/resource_bundle.h" | 28 #include "ui/base/resource/resource_bundle.h" |
| 26 #include "ui/gfx/paint_vector_icon.h" | 29 #include "ui/gfx/paint_vector_icon.h" |
| 27 #include "ui/gfx/text_constants.h" | 30 #include "ui/gfx/text_constants.h" |
| 28 #include "ui/gfx/vector_icons_public.h" | 31 #include "ui/gfx/vector_icons_public.h" |
| 29 #include "ui/views/bubble/bubble_delegate.h" | 32 #include "ui/views/bubble/bubble_delegate.h" |
| 30 #include "ui/views/bubble/bubble_frame_view.h" | 33 #include "ui/views/bubble/bubble_frame_view.h" |
| 31 #include "ui/views/controls/button/label_button.h" | 34 #include "ui/views/controls/button/label_button.h" |
| 32 #include "ui/views/controls/button/label_button_border.h" | 35 #include "ui/views/controls/button/label_button_border.h" |
| 36 #include "ui/views/controls/separator.h" | |
| 37 #include "ui/views/controls/styled_label.h" | |
| 38 #include "ui/views/controls/styled_label_listener.h" | |
| 33 #include "ui/views/controls/table/table_view.h" | 39 #include "ui/views/controls/table/table_view.h" |
| 34 #include "ui/views/controls/table/table_view_observer.h" | 40 #include "ui/views/controls/table/table_view_observer.h" |
| 35 #include "ui/views/layout/box_layout.h" | 41 #include "ui/views/layout/box_layout.h" |
| 36 #include "ui/views/layout/grid_layout.h" | 42 #include "ui/views/layout/grid_layout.h" |
| 43 #include "ui/views/layout/layout_constants.h" | |
| 37 | 44 |
| 38 namespace { | 45 namespace { |
| 39 | 46 |
| 40 // Chooser permission bubble width | 47 // Chooser permission bubble width |
| 41 const int kChooserPermissionBubbleWidth = 300; | 48 const int kChooserPermissionBubbleWidth = 300; |
| 42 | 49 |
| 43 // Chooser permission bubble height | 50 // Chooser permission bubble height |
| 44 const int kChooserPermissionBubbleHeight = 200; | 51 const int kChooserPermissionBubbleHeight = 200; |
| 45 | 52 |
| 46 // Spacing constant for outer margin. This is added to the | |
| 47 // bubble margin itself to equalize the margins at 13px. | |
| 48 const int kBubbleOuterMargin = 5; | |
| 49 | |
| 50 // Spacing between major items should be 9px. | |
| 51 const int kItemMajorSpacing = 9; | |
| 52 | |
| 53 // Button border size, draws inside the spacing distance. | |
| 54 const int kButtonBorderSize = 2; | |
| 55 | |
| 56 } // namespace | 53 } // namespace |
| 57 | 54 |
| 58 scoped_ptr<BubbleUi> ChooserBubbleDelegate::BuildBubbleUi() { | 55 scoped_ptr<BubbleUi> ChooserBubbleDelegate::BuildBubbleUi() { |
| 59 return make_scoped_ptr(new ChooserBubbleUiView(browser_, this)); | 56 return make_scoped_ptr(new ChooserBubbleUiView(browser_, this)); |
| 60 } | 57 } |
| 61 | 58 |
| 62 class ChooserTableModel; | 59 class ChooserTableModel; |
| 63 | 60 |
| 64 /////////////////////////////////////////////////////////////////////////////// | 61 /////////////////////////////////////////////////////////////////////////////// |
| 65 // View implementation for the chooser bubble. | 62 // View implementation for the chooser bubble. |
| 66 class ChooserBubbleUiViewDelegate : public views::BubbleDelegateView, | 63 class ChooserBubbleUiViewDelegate : public views::BubbleDelegateView, |
| 67 public views::ButtonListener, | 64 public views::ButtonListener, |
| 65 public views::StyledLabelListener, | |
| 68 public views::TableViewObserver { | 66 public views::TableViewObserver { |
| 69 public: | 67 public: |
| 70 ChooserBubbleUiViewDelegate(views::View* anchor_view, | 68 ChooserBubbleUiViewDelegate(views::View* anchor_view, |
| 71 views::BubbleBorder::Arrow anchor_arrow, | 69 views::BubbleBorder::Arrow anchor_arrow, |
| 72 ChooserBubbleUiView* owner, | 70 ChooserBubbleUiView* owner, |
| 73 ChooserBubbleDelegate* chooser_bubble_delegate); | 71 ChooserBubbleDelegate* chooser_bubble_delegate); |
| 74 ~ChooserBubbleUiViewDelegate() override; | 72 ~ChooserBubbleUiViewDelegate() override; |
| 75 | 73 |
| 76 void Close(); | 74 void Close(); |
| 77 | 75 |
| 78 // BubbleDelegateView: | 76 // views::BubbleDelegateView: |
| 77 void OnNativeThemeChanged(const ui::NativeTheme* native_theme) override; | |
| 79 bool ShouldShowWindowTitle() const override; | 78 bool ShouldShowWindowTitle() const override; |
| 80 base::string16 GetWindowTitle() const override; | 79 base::string16 GetWindowTitle() const override; |
| 81 void OnWidgetDestroying(views::Widget* widget) override; | 80 void OnWidgetDestroying(views::Widget* widget) override; |
| 82 | 81 |
| 83 // ButtonListener: | 82 // views::ButtonListener: |
| 84 void ButtonPressed(views::Button* button, const ui::Event& event) override; | 83 void ButtonPressed(views::Button* button, const ui::Event& event) override; |
| 85 | 84 |
| 85 // views::StyledLabelListener: | |
| 86 void StyledLabelLinkClicked(views::StyledLabel* label, | |
| 87 const gfx::Range& range, | |
| 88 int event_flags) override; | |
| 89 | |
| 86 // views::TableViewObserver: | 90 // views::TableViewObserver: |
| 87 void OnSelectionChanged() override; | 91 void OnSelectionChanged() override; |
| 88 | 92 |
| 89 // Updates the anchor's arrow and view. Also repositions the bubble so it's | 93 // Updates the anchor's arrow and view. Also repositions the bubble so it's |
| 90 // displayed in the correct location. | 94 // displayed in the correct location. |
| 91 void UpdateAnchor(views::View* anchor_view, | 95 void UpdateAnchor(views::View* anchor_view, |
| 92 views::BubbleBorder::Arrow anchor_arrow); | 96 views::BubbleBorder::Arrow anchor_arrow); |
| 93 | 97 |
| 94 private: | 98 private: |
| 95 friend ChooserBubbleUiView; | 99 friend ChooserBubbleUiView; |
| 96 | 100 |
| 97 ChooserBubbleUiView* owner_; | 101 ChooserBubbleUiView* owner_; |
| 98 ChooserBubbleDelegate* chooser_bubble_delegate_; | 102 ChooserBubbleDelegate* chooser_bubble_delegate_; |
| 99 | 103 |
| 100 views::LabelButton* connect_button_; | 104 views::LabelButton* connect_button_; |
| 101 views::LabelButton* cancel_button_; | |
| 102 views::TableView* table_view_; | 105 views::TableView* table_view_; |
| 103 ChooserTableModel* chooser_table_model_; | 106 ChooserTableModel* chooser_table_model_; |
| 107 base::string16 link_; | |
| 108 std::vector<size_t> offset_; | |
| 109 views::StyledLabel* label_; | |
| 104 bool button_pressed_; | 110 bool button_pressed_; |
| 105 | 111 |
| 106 DISALLOW_COPY_AND_ASSIGN(ChooserBubbleUiViewDelegate); | 112 DISALLOW_COPY_AND_ASSIGN(ChooserBubbleUiViewDelegate); |
| 107 }; | 113 }; |
| 108 | 114 |
| 109 ui::TableColumn ChooserTableColumn(int id, const std::string& title) { | 115 ui::TableColumn ChooserTableColumn(int id, const std::string& title) { |
| 110 ui::TableColumn column; | 116 ui::TableColumn column; |
| 111 column.id = id; | 117 column.id = id; |
| 112 column.title = base::ASCIIToUTF16(title.c_str()); | 118 column.title = base::ASCIIToUTF16(title.c_str()); |
| 113 return column; | 119 return column; |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 139 | 145 |
| 140 ChooserBubbleUiViewDelegate::ChooserBubbleUiViewDelegate( | 146 ChooserBubbleUiViewDelegate::ChooserBubbleUiViewDelegate( |
| 141 views::View* anchor_view, | 147 views::View* anchor_view, |
| 142 views::BubbleBorder::Arrow anchor_arrow, | 148 views::BubbleBorder::Arrow anchor_arrow, |
| 143 ChooserBubbleUiView* owner, | 149 ChooserBubbleUiView* owner, |
| 144 ChooserBubbleDelegate* chooser_bubble_delegate) | 150 ChooserBubbleDelegate* chooser_bubble_delegate) |
| 145 : views::BubbleDelegateView(anchor_view, anchor_arrow), | 151 : views::BubbleDelegateView(anchor_view, anchor_arrow), |
| 146 owner_(owner), | 152 owner_(owner), |
| 147 chooser_bubble_delegate_(chooser_bubble_delegate), | 153 chooser_bubble_delegate_(chooser_bubble_delegate), |
| 148 button_pressed_(false) { | 154 button_pressed_(false) { |
| 155 // TODO(juncai): try using DialogClientView to build the chooser UI view since | |
| 156 // they look similar. | |
| 157 // https://crbug.com/587545 | |
| 158 // ------------------------------------ | |
| 159 // | Chooser bubble title | | |
| 160 // | -------------------------------- | | |
| 161 // | | option 0 | | | |
| 162 // | | option 1 | | | |
| 163 // | | option 2 | | | |
| 164 // | | | | | |
| 165 // | | | | | |
| 166 // | | | | | |
| 167 // | -------------------------------- | | |
| 168 // | [ Connect ] [ Cancel ] | | |
| 169 // |----------------------------------| | |
| 170 // | Not seeing your ...? Get help | | |
| 171 // ------------------------------------ | |
| 172 | |
| 149 views::GridLayout* layout = new views::GridLayout(this); | 173 views::GridLayout* layout = new views::GridLayout(this); |
| 150 SetLayoutManager(layout); | 174 SetLayoutManager(layout); |
| 151 | 175 |
| 152 views::ColumnSet* column_set = layout->AddColumnSet(0); | 176 views::ColumnSet* column_set = layout->AddColumnSet(0); |
| 153 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, | 177 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, |
| 154 views::GridLayout::USE_PREF, 0, 0); | 178 views::GridLayout::USE_PREF, 0, 0); |
| 155 | 179 |
| 156 layout->StartRow(1, 0); | 180 // Lay out the table view. |
| 157 | 181 layout->StartRow(0, 0); |
| 158 // Create a table view | |
| 159 std::vector<ui::TableColumn> table_columns; | 182 std::vector<ui::TableColumn> table_columns; |
| 160 table_columns.push_back(ChooserTableColumn( | 183 table_columns.push_back(ChooserTableColumn( |
| 161 0, "" /* Empty string makes the column title invisible */)); | 184 0, "" /* Empty string makes the column title invisible */)); |
| 162 chooser_table_model_ = new ChooserTableModel(chooser_bubble_delegate_); | 185 chooser_table_model_ = new ChooserTableModel(chooser_bubble_delegate_); |
| 163 table_view_ = new views::TableView(chooser_table_model_, table_columns, | 186 table_view_ = new views::TableView(chooser_table_model_, table_columns, |
| 164 views::TEXT_ONLY, true); | 187 views::TEXT_ONLY, true); |
| 165 table_view_->set_select_on_remove(false); | 188 table_view_->set_select_on_remove(false); |
| 166 chooser_table_model_->SetObserver(table_view_); | 189 chooser_table_model_->SetObserver(table_view_); |
| 167 table_view_->SetObserver(this); | 190 table_view_->SetObserver(this); |
| 191 if (chooser_bubble_delegate_->NumOptions() == 0) | |
| 192 table_view_->SetEnabled(false); | |
| 168 layout->AddView(table_view_->CreateParentIfNecessary(), 1, 1, | 193 layout->AddView(table_view_->CreateParentIfNecessary(), 1, 1, |
| 169 views::GridLayout::FILL, views::GridLayout::FILL, | 194 views::GridLayout::FILL, views::GridLayout::FILL, |
| 170 kChooserPermissionBubbleWidth, | 195 kChooserPermissionBubbleWidth, |
| 171 kChooserPermissionBubbleHeight); | 196 kChooserPermissionBubbleHeight); |
| 172 if (chooser_bubble_delegate_->NumOptions() == 0) { | |
| 173 table_view_->SetEnabled(false); | |
| 174 } | |
| 175 | 197 |
| 176 layout->AddPaddingRow(0, kItemMajorSpacing); | 198 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| 177 | |
| 178 views::View* button_row = new views::View(); | |
| 179 views::GridLayout* button_layout = new views::GridLayout(button_row); | |
| 180 views::ColumnSet* button_columns = button_layout->AddColumnSet(0); | |
| 181 button_row->SetLayoutManager(button_layout); | |
| 182 layout->StartRow(1, 0); | |
| 183 layout->AddView(button_row); | |
| 184 | 199 |
| 185 // Lay out the Connect/Cancel buttons. | 200 // Lay out the Connect/Cancel buttons. |
| 186 button_columns->AddColumn(views::GridLayout::TRAILING, | 201 layout->StartRow(0, 0); |
| 187 views::GridLayout::FILL, 100, | 202 views::View* button_row = new views::View(); |
| 188 views::GridLayout::USE_PREF, 0, 0); | 203 views::BoxLayout* button_layout = new views::BoxLayout( |
| 189 button_columns->AddPaddingColumn(0, | 204 views::BoxLayout::kHorizontal, 0, 0, views::kRelatedButtonHSpacing); |
| 190 kItemMajorSpacing - (2 * kButtonBorderSize)); | 205 button_layout->set_main_axis_alignment( |
| 191 button_columns->AddColumn(views::GridLayout::TRAILING, | 206 views::BoxLayout::MAIN_AXIS_ALIGNMENT_END); |
| 192 views::GridLayout::FILL, 0, | 207 button_row->SetLayoutManager(button_layout); |
| 193 views::GridLayout::USE_PREF, 0, 0); | |
| 194 button_layout->StartRow(0, 0); | |
| 195 | 208 |
| 196 base::string16 connect_text = | 209 base::string16 connect_text = |
| 197 l10n_util::GetStringUTF16(IDS_CHOOSER_BUBBLE_CONNECT_BUTTON_TEXT); | 210 l10n_util::GetStringUTF16(IDS_CHOOSER_BUBBLE_CONNECT_BUTTON_TEXT); |
| 198 connect_button_ = new views::LabelButton(this, connect_text); | 211 connect_button_ = new views::LabelButton(this, connect_text); |
| 199 connect_button_->SetStyle(views::Button::STYLE_BUTTON); | 212 connect_button_->SetStyle(views::Button::STYLE_BUTTON); |
| 200 // Disable the connect button at the beginning since no device selected yet. | 213 // Disable the connect button at the beginning since no device selected yet. |
| 201 connect_button_->SetEnabled(false); | 214 connect_button_->SetEnabled(false); |
| 202 button_layout->AddView(connect_button_); | 215 button_row->AddChildView(connect_button_); |
| 203 chooser_table_model_->SetConnectButton(connect_button_); | 216 chooser_table_model_->SetConnectButton(connect_button_); |
| 204 | 217 |
| 205 base::string16 cancel_text = | 218 base::string16 cancel_text = |
| 206 l10n_util::GetStringUTF16(IDS_CHOOSER_BUBBLE_CANCEL_BUTTON_TEXT); | 219 l10n_util::GetStringUTF16(IDS_CHOOSER_BUBBLE_CANCEL_BUTTON_TEXT); |
| 207 cancel_button_ = new views::LabelButton(this, cancel_text); | 220 views::LabelButton* cancel_button = new views::LabelButton(this, cancel_text); |
| 208 cancel_button_->SetStyle(views::Button::STYLE_BUTTON); | 221 cancel_button->SetStyle(views::Button::STYLE_BUTTON); |
| 209 button_layout->AddView(cancel_button_); | 222 button_row->AddChildView(cancel_button); |
| 223 layout->AddView(button_row); | |
| 210 | 224 |
| 211 button_layout->AddPaddingRow(0, kBubbleOuterMargin); | 225 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| 226 | |
| 227 // Lay out the separator. | |
| 228 layout->StartRow(0, 0); | |
| 229 layout->AddView(new views::Separator(views::Separator::HORIZONTAL)); | |
| 230 | |
| 231 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | |
| 232 | |
| 233 // Lay out the styled label. | |
| 234 layout->StartRow(0, 0); | |
| 235 link_ = l10n_util::GetStringUTF16(IDS_CHOOSER_BUBBLE_GET_HELP_LINK_TEXT); | |
| 236 base::string16 text = l10n_util::GetStringFUTF16( | |
| 237 IDS_CHOOSER_BUBBLE_NO_OPTION_TEXT, | |
| 238 chooser_bubble_delegate_->GetOptionDescription(), link_, &offset_); | |
| 239 label_ = new views::StyledLabel(text, this); | |
| 240 layout->AddView(label_); | |
| 212 } | 241 } |
| 213 | 242 |
| 214 ChooserBubbleUiViewDelegate::~ChooserBubbleUiViewDelegate() { | 243 ChooserBubbleUiViewDelegate::~ChooserBubbleUiViewDelegate() { |
| 215 RemoveAllChildViews(true); | 244 RemoveAllChildViews(true); |
| 216 if (owner_) | 245 if (owner_) |
| 217 owner_->Close(); | 246 owner_->Close(); |
| 218 chooser_table_model_->SetObserver(nullptr); | 247 chooser_table_model_->SetObserver(nullptr); |
| 219 } | 248 } |
| 220 | 249 |
| 221 void ChooserBubbleUiViewDelegate::Close() { | 250 void ChooserBubbleUiViewDelegate::Close() { |
| 222 if (!button_pressed_) | 251 if (!button_pressed_) |
| 223 chooser_bubble_delegate_->Close(); | 252 chooser_bubble_delegate_->Close(); |
| 224 owner_ = nullptr; | 253 owner_ = nullptr; |
| 225 GetWidget()->Close(); | 254 GetWidget()->Close(); |
| 226 } | 255 } |
| 227 | 256 |
| 257 void ChooserBubbleUiViewDelegate::OnNativeThemeChanged( | |
|
Jeffrey Yasskin
2016/02/19 21:25:40
I don't see any other uses of this with RangeStyle
juncai
2016/02/20 02:25:05
This function is not overridden, since I was using
| |
| 258 const ui::NativeTheme* native_theme) { | |
| 259 views::BubbleDelegateView::OnNativeThemeChanged(native_theme); | |
| 260 views::StyledLabel::RangeStyleInfo link_style = | |
| 261 views::StyledLabel::RangeStyleInfo::CreateForLink(); | |
| 262 link_style.color = | |
| 263 GetNativeTheme()->GetSystemColor(ui::NativeTheme::kColorId_LinkEnabled); | |
| 264 label_->AddStyleRange(gfx::Range(offset_[1], offset_[1] + link_.length()), | |
| 265 link_style); | |
| 266 } | |
| 267 | |
| 228 bool ChooserBubbleUiViewDelegate::ShouldShowWindowTitle() const { | 268 bool ChooserBubbleUiViewDelegate::ShouldShowWindowTitle() const { |
| 229 return true; | 269 return true; |
| 230 } | 270 } |
| 231 | 271 |
| 232 base::string16 ChooserBubbleUiViewDelegate::GetWindowTitle() const { | 272 base::string16 ChooserBubbleUiViewDelegate::GetWindowTitle() const { |
| 233 return l10n_util::GetStringUTF16(IDS_CHOOSER_BUBBLE_PROMPT); | 273 return l10n_util::GetStringUTF16(IDS_CHOOSER_BUBBLE_PROMPT); |
| 234 } | 274 } |
| 235 | 275 |
| 236 void ChooserBubbleUiViewDelegate::OnWidgetDestroying(views::Widget* widget) { | 276 void ChooserBubbleUiViewDelegate::OnWidgetDestroying(views::Widget* widget) { |
| 237 views::BubbleDelegateView::OnWidgetDestroying(widget); | 277 views::BubbleDelegateView::OnWidgetDestroying(widget); |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 249 chooser_bubble_delegate_->Select(table_view_->selection_model().active()); | 289 chooser_bubble_delegate_->Select(table_view_->selection_model().active()); |
| 250 else | 290 else |
| 251 chooser_bubble_delegate_->Cancel(); | 291 chooser_bubble_delegate_->Cancel(); |
| 252 | 292 |
| 253 if (owner_) { | 293 if (owner_) { |
| 254 owner_->Close(); | 294 owner_->Close(); |
| 255 owner_ = nullptr; | 295 owner_ = nullptr; |
| 256 } | 296 } |
| 257 } | 297 } |
| 258 | 298 |
| 299 void ChooserBubbleUiViewDelegate::StyledLabelLinkClicked( | |
| 300 views::StyledLabel* label, | |
| 301 const gfx::Range& range, | |
| 302 int event_flags) { | |
| 303 chooser_bubble_delegate_->OpenHelpCenterUrl(); | |
| 304 } | |
| 305 | |
| 259 void ChooserBubbleUiViewDelegate::OnSelectionChanged() { | 306 void ChooserBubbleUiViewDelegate::OnSelectionChanged() { |
| 260 connect_button_->SetEnabled(!table_view_->selection_model().empty()); | 307 connect_button_->SetEnabled(!table_view_->selection_model().empty()); |
| 261 } | 308 } |
| 262 | 309 |
| 263 void ChooserBubbleUiViewDelegate::UpdateAnchor( | 310 void ChooserBubbleUiViewDelegate::UpdateAnchor( |
| 264 views::View* anchor_view, | 311 views::View* anchor_view, |
| 265 views::BubbleBorder::Arrow anchor_arrow) { | 312 views::BubbleBorder::Arrow anchor_arrow) { |
| 266 if (GetAnchorView() == anchor_view && arrow() == anchor_arrow) | 313 if (GetAnchorView() == anchor_view && arrow() == anchor_arrow) |
| 267 return; | 314 return; |
| 268 | 315 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 400 return browser_view->exclusive_access_bubble()->GetView(); | 447 return browser_view->exclusive_access_bubble()->GetView(); |
| 401 | 448 |
| 402 return browser_view->top_container(); | 449 return browser_view->top_container(); |
| 403 } | 450 } |
| 404 | 451 |
| 405 views::BubbleBorder::Arrow ChooserBubbleUiView::GetAnchorArrow() { | 452 views::BubbleBorder::Arrow ChooserBubbleUiView::GetAnchorArrow() { |
| 406 if (browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)) | 453 if (browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)) |
| 407 return views::BubbleBorder::TOP_LEFT; | 454 return views::BubbleBorder::TOP_LEFT; |
| 408 return views::BubbleBorder::NONE; | 455 return views::BubbleBorder::NONE; |
| 409 } | 456 } |
| OLD | NEW |