OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 BrowserView* BrowserView::GetBrowserViewForBrowser(const Browser* browser) { | 533 BrowserView* BrowserView::GetBrowserViewForBrowser(const Browser* browser) { |
534 return static_cast<BrowserView*>(browser->window()); | 534 return static_cast<BrowserView*>(browser->window()); |
535 } | 535 } |
536 | 536 |
537 void BrowserView::InitStatusBubble() { | 537 void BrowserView::InitStatusBubble() { |
538 status_bubble_.reset(new StatusBubbleViews(contents_web_view_)); | 538 status_bubble_.reset(new StatusBubbleViews(contents_web_view_)); |
539 contents_web_view_->SetStatusBubble(status_bubble_.get()); | 539 contents_web_view_->SetStatusBubble(status_bubble_.get()); |
540 } | 540 } |
541 | 541 |
542 void BrowserView::InitPermissionBubbleView() { | 542 void BrowserView::InitPermissionBubbleView() { |
| 543 std::string languages = |
| 544 browser_->profile()->GetPrefs()->GetString(prefs::kAcceptLanguages); |
543 permission_bubble_view_.reset(new PermissionBubbleViewViews( | 545 permission_bubble_view_.reset(new PermissionBubbleViewViews( |
544 GetLocationBarView()->location_icon_view())); | 546 GetLocationBarView()->location_icon_view(), languages)); |
545 } | 547 } |
546 | 548 |
547 gfx::Rect BrowserView::GetToolbarBounds() const { | 549 gfx::Rect BrowserView::GetToolbarBounds() const { |
548 gfx::Rect toolbar_bounds(toolbar_->bounds()); | 550 gfx::Rect toolbar_bounds(toolbar_->bounds()); |
549 if (toolbar_bounds.IsEmpty()) | 551 if (toolbar_bounds.IsEmpty()) |
550 return toolbar_bounds; | 552 return toolbar_bounds; |
551 // The apparent toolbar edges are outside the "real" toolbar edges. | 553 // The apparent toolbar edges are outside the "real" toolbar edges. |
552 toolbar_bounds.Inset(-views::NonClientFrameView::kClientEdgeThickness, 0); | 554 toolbar_bounds.Inset(-views::NonClientFrameView::kClientEdgeThickness, 0); |
553 return toolbar_bounds; | 555 return toolbar_bounds; |
554 } | 556 } |
(...skipping 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2570 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2572 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
2571 gfx::Point icon_bottom( | 2573 gfx::Point icon_bottom( |
2572 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2574 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
2573 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2575 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
2574 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(nullptr)); | 2576 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(nullptr)); |
2575 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2577 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
2576 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2578 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
2577 } | 2579 } |
2578 return top_arrow_height; | 2580 return top_arrow_height; |
2579 } | 2581 } |
OLD | NEW |