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/first_run_bubble.h" | 5 #include "chrome/browser/ui/views/first_run_bubble.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/search_engines/util.h" | 8 #include "chrome/browser/search_engines/util.h" |
9 #include "chrome/browser/ui/browser_list.h" | 9 #include "chrome/browser/ui/browser_list.h" |
10 #include "chrome/browser/ui/views/window.h" | 10 #include "chrome/browser/ui/views/window.h" |
11 #include "grit/generated_resources.h" | 11 #include "grit/generated_resources.h" |
12 #include "ui/base/l10n/l10n_util.h" | 12 #include "ui/base/l10n/l10n_util.h" |
13 #include "ui/base/resource/resource_bundle.h" | 13 #include "ui/base/resource/resource_bundle.h" |
14 #include "ui/views/controls/label.h" | 14 #include "ui/views/controls/label.h" |
15 #include "ui/views/controls/link.h" | 15 #include "ui/views/controls/link.h" |
16 #include "ui/views/layout/grid_layout.h" | 16 #include "ui/views/layout/grid_layout.h" |
17 #include "ui/views/layout/layout_constants.h" | 17 #include "ui/views/layout/layout_constants.h" |
18 | 18 |
19 namespace { | 19 namespace { |
20 const int kAnchorVerticalInset = 5; | 20 const int kAnchorVerticalInset = 5; |
21 const int kTopInset = 1; | 21 const int kTopInset = 1; |
22 const int kLeftInset = 2; | 22 const int kLeftInset = 2; |
23 const int kBottomInset = 7; | 23 const int kBottomInset = 7; |
24 const int kRightInset = 2; | 24 const int kRightInset = 2; |
25 } | 25 } // namespace |
| 26 |
| 27 namespace first_run { |
| 28 void ShowFirstRunDialog(Profile* profile) {} |
| 29 } // namespace first_run |
26 | 30 |
27 // static | 31 // static |
28 FirstRunBubble* FirstRunBubble::ShowBubble(Profile* profile, | 32 FirstRunBubble* FirstRunBubble::ShowBubble(Profile* profile, |
29 views::View* anchor_view) { | 33 views::View* anchor_view) { |
30 FirstRunBubble* delegate = new FirstRunBubble(profile, anchor_view); | 34 FirstRunBubble* delegate = new FirstRunBubble(profile, anchor_view); |
31 browser::CreateViewsBubble(delegate); | 35 browser::CreateViewsBubble(delegate); |
32 delegate->StartFade(true); | 36 delegate->StartFade(true); |
33 return delegate; | 37 return delegate; |
34 } | 38 } |
35 | 39 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 FirstRunBubble::~FirstRunBubble() { | 89 FirstRunBubble::~FirstRunBubble() { |
86 } | 90 } |
87 | 91 |
88 void FirstRunBubble::LinkClicked(views::Link* source, int event_flags) { | 92 void FirstRunBubble::LinkClicked(views::Link* source, int event_flags) { |
89 // Get |profile_|'s browser before closing the bubble, which deletes |this|. | 93 // Get |profile_|'s browser before closing the bubble, which deletes |this|. |
90 Browser* browser = BrowserList::GetLastActiveWithProfile(profile_); | 94 Browser* browser = BrowserList::GetLastActiveWithProfile(profile_); |
91 GetWidget()->Close(); | 95 GetWidget()->Close(); |
92 if (browser) | 96 if (browser) |
93 browser->OpenSearchEngineOptionsDialog(); | 97 browser->OpenSearchEngineOptionsDialog(); |
94 } | 98 } |
OLD | NEW |