| 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/sync/one_click_signin_bubble_view.h" | 5 #include "chrome/browser/ui/views/sync/one_click_signin_bubble_view.h" |
| 6 | 6 |
| 7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "chrome/browser/google/google_util.h" | 10 #include "chrome/browser/google/google_util.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 OneClickSigninDialogView::OneClickSigninDialogView( | 72 OneClickSigninDialogView::OneClickSigninDialogView( |
| 73 content::WebContents* web_content, | 73 content::WebContents* web_content, |
| 74 views::View* anchor_view, | 74 views::View* anchor_view, |
| 75 const BrowserWindow::StartSyncCallback& start_sync_callback) | 75 const BrowserWindow::StartSyncCallback& start_sync_callback) |
| 76 : OneClickSigninBubbleView(anchor_view, start_sync_callback), | 76 : OneClickSigninBubbleView(anchor_view, start_sync_callback), |
| 77 web_content_(web_content), | 77 web_content_(web_content), |
| 78 learn_more_link_(NULL), | 78 learn_more_link_(NULL), |
| 79 close_button_(NULL) { | 79 close_button_(NULL) { |
| 80 set_arrow_location(views::BubbleBorder::NONE); | 80 set_arrow_location(views::BubbleBorder::NONE); |
| 81 set_anchor_insets(gfx::Insets(0, 0, anchor_view->height() / 2, 0)); | 81 set_anchor_view_insets(gfx::Insets(0, 0, anchor_view->height() / 2, 0)); |
| 82 set_close_on_deactivate(false); | 82 set_close_on_deactivate(false); |
| 83 set_margins(gfx::Insets(kDialogMargin, kDialogMargin, kDialogMargin, | 83 set_margins(gfx::Insets(kDialogMargin, kDialogMargin, kDialogMargin, |
| 84 kDialogMargin)); | 84 kDialogMargin)); |
| 85 } | 85 } |
| 86 | 86 |
| 87 ui::ModalType OneClickSigninDialogView::GetModalType() const { | 87 ui::ModalType OneClickSigninDialogView::GetModalType() const { |
| 88 return ui::MODAL_TYPE_CHILD; | 88 return ui::MODAL_TYPE_CHILD; |
| 89 } | 89 } |
| 90 | 90 |
| 91 void OneClickSigninDialogView::InitContent(views::GridLayout* layout) { | 91 void OneClickSigninDialogView::InitContent(views::GridLayout* layout) { |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST); | 353 OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST); |
| 354 } | 354 } |
| 355 | 355 |
| 356 void OneClickSigninBubbleView::ButtonPressed(views::Button* sender, | 356 void OneClickSigninBubbleView::ButtonPressed(views::Button* sender, |
| 357 const ui::Event& event) { | 357 const ui::Event& event) { |
| 358 StartFade(false); | 358 StartFade(false); |
| 359 base::ResetAndReturn(&start_sync_callback_).Run((sender == ok_button_) ? | 359 base::ResetAndReturn(&start_sync_callback_).Run((sender == ok_button_) ? |
| 360 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS : | 360 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS : |
| 361 OneClickSigninSyncStarter::UNDO_SYNC); | 361 OneClickSigninSyncStarter::UNDO_SYNC); |
| 362 } | 362 } |
| OLD | NEW |