| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos/profiles/multiprofiles_session_aborted_dialog.
h" | 5 #include "chrome/browser/chromeos/profiles/multiprofiles_session_aborted_dialog.
h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/lifetime/application_lifetime.h" | 9 #include "chrome/browser/lifetime/application_lifetime.h" |
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 // views::DialogDelegate overrides. | 40 // views::DialogDelegate overrides. |
| 41 virtual bool Accept() OVERRIDE; | 41 virtual bool Accept() OVERRIDE; |
| 42 virtual int GetDialogButtons() const OVERRIDE; | 42 virtual int GetDialogButtons() const OVERRIDE; |
| 43 virtual base::string16 GetDialogButtonLabel( | 43 virtual base::string16 GetDialogButtonLabel( |
| 44 ui::DialogButton button) const OVERRIDE; | 44 ui::DialogButton button) const OVERRIDE; |
| 45 | 45 |
| 46 // views::WidgetDelegate overrides. | 46 // views::WidgetDelegate overrides. |
| 47 virtual ui::ModalType GetModalType() const OVERRIDE; | 47 virtual ui::ModalType GetModalType() const OVERRIDE; |
| 48 | 48 |
| 49 // views::View overrides. | 49 // views::View overrides. |
| 50 virtual gfx::Size GetPreferredSize() OVERRIDE; | 50 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 void InitDialog(const std::string& user_email); | 53 void InitDialog(const std::string& user_email); |
| 54 | 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(MultiprofilesSessionAbortedView); | 55 DISALLOW_COPY_AND_ASSIGN(MultiprofilesSessionAbortedView); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 //////////////////////////////////////////////////////////////////////////////// | 58 //////////////////////////////////////////////////////////////////////////////// |
| 59 // MultiprofilesSessionAbortedView implementation. | 59 // MultiprofilesSessionAbortedView implementation. |
| 60 | 60 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 base::string16 MultiprofilesSessionAbortedView::GetDialogButtonLabel( | 98 base::string16 MultiprofilesSessionAbortedView::GetDialogButtonLabel( |
| 99 ui::DialogButton button) const { | 99 ui::DialogButton button) const { |
| 100 return l10n_util::GetStringUTF16( | 100 return l10n_util::GetStringUTF16( |
| 101 IDS_MULTIPROFILES_SESSION_ABORT_BUTTON_LABEL); | 101 IDS_MULTIPROFILES_SESSION_ABORT_BUTTON_LABEL); |
| 102 } | 102 } |
| 103 | 103 |
| 104 ui::ModalType MultiprofilesSessionAbortedView::GetModalType() const { | 104 ui::ModalType MultiprofilesSessionAbortedView::GetModalType() const { |
| 105 return ui::MODAL_TYPE_SYSTEM; | 105 return ui::MODAL_TYPE_SYSTEM; |
| 106 } | 106 } |
| 107 | 107 |
| 108 gfx::Size MultiprofilesSessionAbortedView::GetPreferredSize() { | 108 gfx::Size MultiprofilesSessionAbortedView::GetPreferredSize() const { |
| 109 return gfx::Size(kDefaultWidth, kDefaultHeight); | 109 return gfx::Size(kDefaultWidth, kDefaultHeight); |
| 110 } | 110 } |
| 111 | 111 |
| 112 void MultiprofilesSessionAbortedView::InitDialog( | 112 void MultiprofilesSessionAbortedView::InitDialog( |
| 113 const std::string& user_email) { | 113 const std::string& user_email) { |
| 114 const gfx::Insets kDialogInsets(kTopInset, kInset, kInset, kInset); | 114 const gfx::Insets kDialogInsets(kTopInset, kInset, kInset, kInset); |
| 115 | 115 |
| 116 // Create the views and layout manager and set them up. | 116 // Create the views and layout manager and set them up. |
| 117 views::GridLayout* grid_layout = views::GridLayout::CreatePanel(this); | 117 views::GridLayout* grid_layout = views::GridLayout::CreatePanel(this); |
| 118 grid_layout->SetInsets(kDialogInsets); | 118 grid_layout->SetInsets(kDialogInsets); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 149 } // namespace | 149 } // namespace |
| 150 | 150 |
| 151 //////////////////////////////////////////////////////////////////////////////// | 151 //////////////////////////////////////////////////////////////////////////////// |
| 152 // Factory function. | 152 // Factory function. |
| 153 | 153 |
| 154 void ShowMultiprofilesSessionAbortedDialog(const std::string& user_email) { | 154 void ShowMultiprofilesSessionAbortedDialog(const std::string& user_email) { |
| 155 MultiprofilesSessionAbortedView::ShowDialog(user_email); | 155 MultiprofilesSessionAbortedView::ShowDialog(user_email); |
| 156 } | 156 } |
| 157 | 157 |
| 158 } // namespace chromeos | 158 } // namespace chromeos |
| OLD | NEW |