| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/intents/web_intent_picker_delegate.h" | 9 #include "chrome/browser/ui/intents/web_intent_picker_delegate.h" |
| 10 #include "chrome/browser/ui/intents/web_intent_picker.h" | 10 #include "chrome/browser/ui/intents/web_intent_picker.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 point = gfx::Point(width - kIconHorizontalOffset, 0); | 160 point = gfx::Point(width - kIconHorizontalOffset, 0); |
| 161 } | 161 } |
| 162 point.Offset(0, kIconVerticalOffset); | 162 point.Offset(0, kIconVerticalOffset); |
| 163 views::View::ConvertPointToScreen(browser_view->toolbar()->location_bar(), | 163 views::View::ConvertPointToScreen(browser_view->toolbar()->location_bar(), |
| 164 &point); | 164 &point); |
| 165 gfx::Rect bounds = browser_view->toolbar()->location_bar()->bounds(); | 165 gfx::Rect bounds = browser_view->toolbar()->location_bar()->bounds(); |
| 166 bounds.set_origin(point); | 166 bounds.set_origin(point); |
| 167 bounds.set_width(kIconHorizontalOffset); | 167 bounds.set_width(kIconHorizontalOffset); |
| 168 | 168 |
| 169 bubble_ = Bubble::Show(browser_view->GetWidget(), bounds, | 169 bubble_ = Bubble::Show(browser_view->GetWidget(), bounds, |
| 170 views::BubbleBorder::TOP_LEFT, this, this); | 170 views::BubbleBorder::TOP_LEFT, |
| 171 views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR, |
| 172 this, this); |
| 171 } | 173 } |
| 172 | 174 |
| 173 WebIntentPickerView::~WebIntentPickerView() { | 175 WebIntentPickerView::~WebIntentPickerView() { |
| 174 } | 176 } |
| 175 | 177 |
| 176 void WebIntentPickerView::ButtonPressed(views::Button* sender, | 178 void WebIntentPickerView::ButtonPressed(views::Button* sender, |
| 177 const views::Event& event) { | 179 const views::Event& event) { |
| 178 // TODO(binji) When we support the plus button, pressing it should forward the | 180 // TODO(binji) When we support the plus button, pressing it should forward the |
| 179 // user to services in the Chrome Web Store that provide this intent. | 181 // user to services in the Chrome Web Store that provide this intent. |
| 180 if (sender == plus_button_) | 182 if (sender == plus_button_) |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 views::Label* bottom_label = new views::Label( | 276 views::Label* bottom_label = new views::Label( |
| 275 l10n_util::GetStringUTF16(IDS_FIND_MORE_INTENT_HANDLER_MESSAGE)); | 277 l10n_util::GetStringUTF16(IDS_FIND_MORE_INTENT_HANDLER_MESSAGE)); |
| 276 bottom_label->SetMultiLine(true); | 278 bottom_label->SetMultiLine(true); |
| 277 bottom_label->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 279 bottom_label->SetHorizontalAlignment(views::Label::ALIGN_LEFT); |
| 278 bottom_label->SetFont( | 280 bottom_label->SetFont( |
| 279 bottom_label->font().DeriveFont(kWebStoreLabelFontDelta)); | 281 bottom_label->font().DeriveFont(kWebStoreLabelFontDelta)); |
| 280 main_content->AddChildView(bottom_label); | 282 main_content->AddChildView(bottom_label); |
| 281 | 283 |
| 282 AddChildView(main_content); | 284 AddChildView(main_content); |
| 283 } | 285 } |
| OLD | NEW |