| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser_bubble.h" | 5 #include "chrome/browser/ui/views/browser_bubble.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "chrome/browser/ui/views/frame/browser_view.h" | 9 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 10 #include "views/widget/widget_gtk.h" | 10 #include "views/widget/widget_gtk.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 private: | 77 private: |
| 78 BrowserBubble* bubble_; | 78 BrowserBubble* bubble_; |
| 79 | 79 |
| 80 DISALLOW_COPY_AND_ASSIGN(BubbleWidget); | 80 DISALLOW_COPY_AND_ASSIGN(BubbleWidget); |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 } // namespace | 83 } // namespace |
| 84 | 84 |
| 85 void BrowserBubble::InitPopup() { | 85 void BrowserBubble::InitPopup() { |
| 86 // TODO(port) | 86 // TODO(port) |
| 87 DCHECK(!drop_shadow_enabled_) << | |
| 88 "Drop shadows not supported on GTK browser bubbles."; | |
| 89 | |
| 90 views::WidgetGtk* pop = new BubbleWidget(this); | 87 views::WidgetGtk* pop = new BubbleWidget(this); |
| 91 pop->SetOpacity(0xFF); | 88 pop->SetOpacity(0xFF); |
| 92 pop->make_transient_to_parent(); | 89 pop->make_transient_to_parent(); |
| 93 pop->Init(frame_->GetNativeView(), bounds_); | 90 pop->Init(frame_->GetNativeView(), bounds_); |
| 94 #if defined(OS_CHROMEOS) | 91 #if defined(OS_CHROMEOS) |
| 95 { | 92 { |
| 96 vector<int> params; | 93 vector<int> params; |
| 97 params.push_back(0); // don't show while screen is locked | 94 params.push_back(0); // don't show while screen is locked |
| 98 chromeos::WmIpc::instance()->SetWindowType( | 95 chromeos::WmIpc::instance()->SetWindowType( |
| 99 pop->GetNativeView(), | 96 pop->GetNativeView(), |
| (...skipping 19 matching lines...) Expand all Loading... |
| 119 visible_ = true; | 116 visible_ = true; |
| 120 } | 117 } |
| 121 | 118 |
| 122 void BrowserBubble::Hide() { | 119 void BrowserBubble::Hide() { |
| 123 if (!visible_) | 120 if (!visible_) |
| 124 return; | 121 return; |
| 125 views::WidgetGtk* pop = static_cast<views::WidgetGtk*>(popup_); | 122 views::WidgetGtk* pop = static_cast<views::WidgetGtk*>(popup_); |
| 126 pop->Hide(); | 123 pop->Hide(); |
| 127 visible_ = false; | 124 visible_ = false; |
| 128 } | 125 } |
| OLD | NEW |