Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: chrome_frame/ready_mode/internal/ready_prompt_content.cc

Issue 6314016: Update the Ready Mode UI in response to feedback from UI leads, Chrome Frame ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_frame/ready_mode/internal/ready_prompt_content.h" 5 #include "chrome_frame/ready_mode/internal/ready_prompt_content.h"
6 6
7 #include <atlbase.h>
8 #include <atlwin.h>
9
10 #include "base/logging.h" 7 #include "base/logging.h"
11 #include "chrome_frame/ready_mode/internal/ready_mode_state.h" 8 #include "chrome_frame/ready_mode/internal/ready_mode_state.h"
12 #include "chrome_frame/ready_mode/internal/ready_prompt_window.h" 9 #include "chrome_frame/ready_mode/internal/ready_prompt_window.h"
10 #include "chrome_frame/ready_mode/internal/url_launcher.h"
13 11
14 ReadyPromptContent::ReadyPromptContent(ReadyModeState* ready_mode_state) 12 ReadyPromptContent::ReadyPromptContent(ReadyModeState* ready_mode_state,
15 : ready_mode_state_(ready_mode_state) { 13 UrlLauncher* url_launcher)
14 : ready_mode_state_(ready_mode_state),
15 url_launcher_(url_launcher) {
16 } 16 }
17 17
18 ReadyPromptContent::~ReadyPromptContent() { 18 ReadyPromptContent::~ReadyPromptContent() {
19 if (window_ != NULL && window_->IsWindow()) { 19 if (window_ != NULL && window_->IsWindow()) {
20 // The window must discard its ContentFrame pointer at this time. 20 // The window must discard its ContentFrame pointer at this time.
21 window_->DestroyWindow(); 21 window_->DestroyWindow();
22 window_.reset(); 22 window_.reset();
23 } 23 }
24 } 24 }
25 25
26 bool ReadyPromptContent::InstallInFrame(Frame* frame) { 26 bool ReadyPromptContent::InstallInFrame(Frame* frame) {
27 DCHECK(window_ == NULL); 27 DCHECK(window_ == NULL);
28 DCHECK(ready_mode_state_ != NULL); 28 DCHECK(ready_mode_state_ != NULL);
29 DCHECK(url_launcher_ != NULL);
29 30
30 // The window owns itself upon call to Initialize. 31 // Pass ownership of our ready_mode_state_ and url_launcher_ to the window.
31 ReadyPromptWindow* new_window_ = new ReadyPromptWindow(); 32 window_ = ReadyPromptWindow::CreateInstance(
32 window_ = new_window_->Initialize(frame, ready_mode_state_.release()); 33 frame, ready_mode_state_.release(), url_launcher_.release());
33 34
34 return window_ != NULL; 35 return window_ != NULL;
35 } 36 }
36 37
37 void ReadyPromptContent::SetDimensions(const RECT& dimensions) { 38 void ReadyPromptContent::SetDimensions(const RECT& dimensions) {
38 if (window_ != NULL && window_->IsWindow()) { 39 if (window_ != NULL && window_->IsWindow()) {
39 window_->SetWindowPos(HWND_TOP, &dimensions, 40 window_->SetWindowPos(HWND_TOP, &dimensions,
40 ::IsRectEmpty(&dimensions) ? SWP_HIDEWINDOW : 41 ::IsRectEmpty(&dimensions) ? SWP_HIDEWINDOW :
41 SWP_SHOWWINDOW); 42 SWP_SHOWWINDOW);
42 } 43 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 if (window_ == NULL || !window_->IsWindow()) { 94 if (window_ == NULL || !window_->IsWindow()) {
94 return 0; 95 return 0;
95 } 96 }
96 RECT dialog_dimensions = {0, 0, 0, 0}; 97 RECT dialog_dimensions = {0, 0, 0, 0};
97 98
98 if (GetDialogTemplateDimensions(window_.get(), &dialog_dimensions)) 99 if (GetDialogTemplateDimensions(window_.get(), &dialog_dimensions))
99 return width == 0 ? dialog_dimensions.right : dialog_dimensions.bottom; 100 return width == 0 ? dialog_dimensions.right : dialog_dimensions.bottom;
100 else 101 else
101 return width == 0 ? 0 : 39; 102 return width == 0 ? 0 : 39;
102 } 103 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698